removeWrapping can be called when there are still wrapped tokens
The contract owner could call removeWrapping even when wrapped tokens were still in circulation, which would set the unwrapped token address to zero and prevent users from unwrapping their tokens. This could lock users' wrapped tokens permanently.
Submitted by Lambda, also found by 0x52 and cryptphi
An owner can call removeWrapping, even if there are still circulating wrapped tokens. This will cause the unwrapping of those tokens to fail, as unwrapped[wrappedToken] will be addres(0).
Recommended Mitigation Steps
Track how many wrapped tokens are in circulation, only allow the removal of a wrapped tokens when there are 0 to ensure for users that they will always be able to unwrap.
re1ro (Axelar) confirmed and commented:
Valid observation. We will consider a different approach.
Mitigation
removeWrappingmethod was removed https://github.com/axelarnetwork/axelar-xc20-wrapper/pull/4
Alex the Entreprenerd (judge) commented:
The warden has shown how the Admin can remove the mapping that allows to redeem bridged tokens, because this will cause the inability to unwrap, and can be operated by the admin, I agree with Medium Severity.
The sponsor has confirmed and they have mitigated by removing the function.
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
The contract did not track the number of wrapped tokens in circulation before allowing the owner to remove the wrapping configuration.
Impact
Users could be unable to unwrap their tokens, effectively locking them, if the owner removes wrapping while tokens are still circulating.
What the attacker needed
Owner calls removeWrapping; wrapped tokens still in circulation
The fix
The removeWrapping function was removed entirely to prevent the issue.
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.
This is a smart contract bug where the owner has a special function to stop wrapping tokens. If the owner calls it while people still hold wrapped tokens, those people can't convert their tokens back to the original ones because the contract forgets the original token's address. So their tokens get stuck.
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.