Contract Owner Possesses Too Many Privileges
The ExecutionDelegate contract allows the project owner to approve any contract to transfer users' approved tokens, and users cannot revoke approval before the owner acts. An attacker with the owner's key could steal all approved funds.
Submitted by Soosh, also found by 0x1f8b, 0x4non, 0xc0ffEE, arcoun, cccz, d3e4, minhtrng, RaymondFam, rotcivegaf, Ruhum, RustyRabbit, saian, sakshamguruji, and Trust
To use the protocol (buy/sell NFTs), users must approve the ExecutionDelegate to handle transfers for their ERC721, ERC1155, or ERC20 tokens.
The safety mechanisms mentioned by the protocol do not protect users at all if the project’s owner decides to rugpull.
From the contest page, Safety Features:
- The calling contract must be approved on the
ExecutionDelegate - Users have the ability to revoke approval from the
ExecutionDelegatewithout having to individually calling every token contract.
Proof of Concept
function transferERC20(address token, address from, address to, uint256 amount)
approvedContract
external
returns (bool)
{
require(revokedApproval[from] == false, "User has revoked approval");
return IERC20(token).transferFrom(from, to, amount);
}
The owner can set approvedContract to any address at any time with approveContract(address _contract), and revokeApproval() can be frontrun. As a result, all user funds approved to the ExecutionDelegate contract can be lost via rugpull.
Justification
While rug-pulling may not be the project’s intention, I find that this is still an inherently dangerous design.
I am unsure about the validity of centralization risk findings on C4, but I argue this is a valid High risk issue as:
-
It is too easy to steal all of user funds as a project owner. A single Bored Ape NFT traded on the exchange would mean roughly
$200,000can be stolen based on current floor price (75.6 ETH as of writing, Source: https://nftpricefloor.com/bored-ape-yacht-club).$200kbecause 75.6ETH for NFT seller and at least 75.6ETH approved by buyer. -
web3 security should not be based on “trust”.
-
Assuming the project owner is not malicious and will never rug-pull:
- 1 successful phishing attack (private key compromise) against the project’s owner is all it takes to wipe the protocol out.
- The protocol is still affected as user’s will not want to trade on a platfrom knowing such an attack is possible.
Recommended Mitigation Steps
This is due to an insecure design of the protocol. So as far as recommendations go, the team should reconsider the protocol’s design.
I do not think ExecutionDelegate should be used. It would be better if BlurExchange.sol is approved by users instead. The exchange should require that the buyer has received their NFT and the seller has received their ETH/WETH or revert.
Alex the Entreprenerd (Judge) decreased severity and commented:
Refactoring.
Alex the Entreprenerd (Judge) increased severity to Medium and commented:
Per discussion in https://github.com/code-423n4/org/issues, as well as discussion at End of Contest Triage.
Am changing the judging on these issues, as these reports have shown a risk to end-users and have historically rated Admin Privilege as a Medium Severity.
Am making this the primary as it clearly shows the risk for end users.
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
Impact
All user funds approved to the ExecutionDelegate contract could be stolen via a rugpull or if the owner's private key is compromised.
What the attacker needed
Users must approve ExecutionDelegate; owner key or malicious owner
The fix
The protocol should be redesigned so that users approve the exchange contract directly, and the exchange ensures atomic settlement where the buyer receives the NFT and the seller receives payment or the transaction reverts.
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.
In this NFT marketplace, users must approve a helper contract to move their tokens when they trade. The problem is that the project owner can secretly let another contract move those tokens too, and users cannot stop it in time. So if the owner turns bad or their key is stolen, all approved funds can be taken.
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.