Upgradable escrow contract
The escrow contract is upgradeable, so users must approve their NFTs to an admin-controlled contract that can be changed. An attacker who compromises the admin could upgrade the contract to transfer approved NFTs to themselves.
Submitted by gzeon
Upgradable escrow contract poses great risk to user who approved their NFT to the contract. Most popular token / NFT exchange do not require user to approve their asset to admin upgradable contract.
This also increases user gas usage because they would have to revoke approval when they are done with the protocol.
Proof of Concept
Recommended Mitigation Steps
Separate the escrow contract to make it non-upgradable with a restricted set of functionality.
NickCuso (Foundation) acknowledged and commented:
This is an interesting suggestion. I’m not sure if the recommendation really reduces the risk though. If we were to make the escrow portion immutable, the trust still depends on the upgradeable market contract to do the correct thing. If I’m understanding the suggestion correctly, the terms of the deal would still be defined in the upgradeable contract - so even with an immutable escrow manager we could theoretically upgrade the market to allow us to
buyeach of the NFTs for 0 ETH.
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 escrow logic is part of an upgradeable contract, so the admin can change the code that controls approved NFTs.
Impact
An attacker with admin access could upgrade the contract to steal NFTs that users have approved, though the report does not demonstrate this.
What the attacker needed
User approves NFT to contract; admin key compromised or malicious
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 escrow contract holds your NFT while it is for sale. Because this contract can be upgraded by an admin, the admin could change the rules and take the NFT you approved. You have to trust the admin not to do this.
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.