NFT owner can change token URI
The ERC721OnChain contract allows the owner of an NFT to change its token URI, which is normally set by the contract owner. An attacker who owns an NFT could spoof another NFT's data by changing the token URI to point to that other NFT's data.
Submitted by cmichel
In the ERC721OnChain implementation the token owner can set the token’s URI using setTokenURI.
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
DimaStebaev (SKALE) disputed and commented:
Acknowledged,
ERC721OnChainis 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.
GalloDaSballo (judge) commented:
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
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the setTokenURI function does not restrict who can call it, allowing the token owner instead of only the contract owner to change the URI.
What the attacker needed
Own an NFT from the contract
The fix
The owner of an NFT should not be allowed to change its token URI.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
An NFT is a digital token; its token URI is a link to information like its picture and properties. Normally only the contract owner can set that link, but here the person who owns the NFT can change it, so they could make their NFT look like a different one.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.