Approvals are not revoked on transfer #56
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-160
edited-by-warden
🤖_22_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
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
Lines of code
https://github.com/code-423n4/2024-08-superposition/blob/main/pkg/sol/OwnershipNFTs.sol#L98-L116
Vulnerability details
Currently, approvals allow other users to transfer tokens on behalf of the owner. However, the approval is not revoked after a transfer, leaving the approved user with continued authority over the tokens, even after they are transferred to a new owner. This could enable the approved user to retain control over the tokens, even when they no longer belong to the original owner.
Impact
Unauthorized Token Control: Previously approved addresses retain permissions to operate on the token even after it has been transferred to a new owner. This could lead to unauthorized transfers or actions on the new owner’s token.
Non-Compliance with ERC721 Standard: By failing to clear approvals post-transfer, the contract deviates from the ERC721 standard, impacting both its security and functionality.
Proof of Concept
Tools Used
Manual Review
Recommended Mitigation Steps
function _transfer( address _from, address _to, uint256 _tokenId ) internal { _requireAuthorised(_from, _tokenId); SEAWATER.transferPositionEEC7A3CD(_tokenId, _from, _to); + delete getApproved[_tokenId]; }
Assessed type
Token-Transfer
The text was updated successfully, but these errors were encountered: