approve()
shouldn't be called by the approved address for that tokenId
#65
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
primary issue
Highest quality submission among a set of duplicates
🤖_10_group
AI based duplicate group recommendation
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
sufficient quality report
This report is of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-08-superposition/blob/4528c9d2dbe1550d2660dac903a8246076044905/pkg/sol/OwnershipNFTs.sol#L161
Vulnerability details
Impact
The current implementation of
OwnershipNFTs::approve()
function allows theapproved
address to callapprove()
on the sametokenId
for which he is approved. This puts the owner at risk as any approved address can proceed to approve any other users to this token without his consent.Proof of Concept
EIP721 states that
approve()
:/// Throws unless `msg.sender` is the current NFT owner, or an authorized operator of the current owner.
However, the current implementation breaks this access control provided by the standard.
In the contract,
approve()
uses_requireAuthorised()
which checks if:This setup violates the set standard as it should only check the caller is
current NFT owner
, or anauthorized operator
.Tools Used
Manual Review
Recommended Mitigation Steps
When
approve()
is called, check only ifmsg.sender
is theowner
, orisApprovedForAll
.Assessed type
Access Control
The text was updated successfully, but these errors were encountered: