sherlock-audit / 2024-01-telcoin-judging

6 stars 5 forks source link

r0ck3tz - Authorization added to approve function can be bypassed #203

Closed sherlock-admin2 closed 6 months ago

sherlock-admin2 commented 6 months ago

r0ck3tz

medium

Authorization added to approve function can be bypassed

Summary

The approve function has been limited to GOVERNANCE_COUNCIL_ROLE but the owner of the token can bypass this functionality and use setApprovalForAll function to allow spending tokens by a third-party contract.

Vulnerability Detail

The approve function has been limited to GOVERNANCE_COUNCIL_ROLE and allows setting approval for any token to any address. The owner of the token can use setApprovalForAll function and set third-party contract as an operator which will allow to bypass authorization added to approve function.

Impact

The users can use setApprovalForAll and allow any contract to spend the ERC721 tokens bypassing authorization added to approve function.

Code Snippet

Tool used

Manual Review

Recommendation

It is recommended to:

Duplicate of #243

sherlock-admin2 commented 6 months ago

1 comment(s) were left on this issue during the judging contest.

takarez commented:

valid because { This is valid and a dupp of 190 due to the same underlying cause of not overriden a function}