Escrow approvals are not cleared when club is transferred allowing for abuse after transfer
Escrow approvals for ERC20 and ERC721 tokens were not cleared when a club token was transferred, so a malicious club owner could set approvals to themselves, sell the club, and then drain all players and tokens using the persistent approvals.
Source: https://github.com/sherlock-audit/2023-04-footium-judging/issues/289
Found by
0x52, BenRai, Brenzee, CMierez, J4de, MiloTruck, PokemonAuditSimulator, Quantish, cergyk, ctf_sec, mstpr-brainbot, pengun, sashik_eth, shaka, shogoki, toshii
Summary
Escrow approvals remain even across club token transfers. This allows a malicious club owners to sell their club then drain everything after sale due to previous approvals.
Vulnerability Detail
ERC20 and ERC721 token approval persist regardless of the owner of the club. The result is that approvals set by one owner can be accessed after a token has been sold or transferred. This allows the following attack:
- User A owns clubId = 1
- User A sets approval to themselves
- User A sells clubId = 1 to User B
- User A uses persistent approval to drain all players and tokens
Impact
Malicious approvals can be used to drain club after sale
Code Snippet
Tool used
Manual Review
Recommendation
Club escrow system needs to be redesigned
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 contract did not revoke existing token approvals when the club token was transferred to a new owner.
Impact
A malicious club owner could drain all players and tokens from a club after selling it.
What the attacker needed
Attacker owns a club; Attacker sets approval to themselves; Attacker sells club to victim
The fix
The club escrow system should be redesigned to clear approvals when the club is transferred.
How it was found
- User A owns clubId = 1
- User A sets approval to themselves
- User A sells clubId = 1 to User B
- User A uses persistent approval to drain all players and tokens
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.
When you approve someone to spend your tokens, that permission stays until you revoke it, even if the tokens change hands. Here, the club's escrow contract kept old approvals after the club was sold, so the previous owner could still take everything out. The fix is to clear approvals whenever ownership changes.
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.