Open code423n4 opened 2 years ago
ERC721OnChain
is a default implementation. If the token is sensitive to URI change SKALE chain owner can use another one.
Not all ERC721 require that URI can't be changed.
Because the argument for this being a setting can be made I am excluding a high severity.
However the code was brought into scope, the implementation under scrutiny does allow the owner to change the URI which is a known admin privilege.
For those reasons I believe the finding to be valid and of medium severity
Lines of code
https://github.com/skalenetwork/ima-c4-audit/blob/11d6a6ae5bf16af552edd75183791375e501915f/contracts/schain/tokens/ERC721OnChain.sol#L73
Vulnerability details
Impact
In the
ERC721OnChain
implementation the token owner can set the token's URI usingsetTokenURI
. Usually, this is token URI points to data defining the NFT (attributes, images, etc.). It's usually set by the contract owner. A user that owns an NFT can just spoof any other NFT data by changing the token URI to any of the other NFTs.Recommended Mitigation Steps
Disallow the owner of an NFT to change its token URI