Submitted by Abdessamed, also found by ABAIKUNANBAEV
In Cairo contracts, when handling cross-chain messages or callbacks, the contract ensures that the handler on the same chain (Starknet) is whitelisted:
In this context, handlers on Starknet must whitelist themselves as supported handlers. However, this introduces a significant vulnerability: since handlers are self-whitelisted, a malicious user could send cross-chain messages to the same chain (Starknet to Starknet) and exploit the BurnUnlock mode as follows:
In BurnUnlock mode, when a cross-chain message is sent, the users tokens are burned, and when the message is received, the same amount of tokens is unlocked. This opens the door for malicious actors to repeatedly send cross-chain messages to themselves, resulting in a continuous unlock of tokens:
By continuously sending cross-chain messages to the same chain, the malicious user can drain the handlers funds by repeatedly unlocking tokens to their own address. As a result, other legitimate cross-chain ERC20 operations will fail due to the depletion of ERC20 tokens in the handler contract.
The self-whitelisting of handlers introduces unnecessary risk and facilitates the aforementioned vulnerability. Consider removing the check that forces handlers to be self-whitelisted:
zvlwwj (Chakra) confirmed:
0xsomeone (judge) invalidated and commented:
Abdessamed (warden) commented:
0xsomeone (judge) commented:
Abdessamed (warden) commented:
0xsomeone (judge) increased severity to High and commented:
