Description:
The withdraw_auto_from_l1
function processes messages from L1 to withdraw tokens on L2. However, there is no mechanism to prevent the same L1 message from being processed multiple times (a replay attack). If an attacker can resend an old message, they might be able to withdraw the same tokens multiple times.
Location:
withdraw_auto_from_l1
function in blockchain/starknet/src/bridge.cairo
line 128, Around the lines where the request is processed and validated in the withdraw_auto_from_l1
function.
Issue:
The function does not store or check if a request has already been processed, allowing for replay attacks.
Impact:
An attacker could withdraw the same tokens multiple times, leading to loss of funds or duplicate asset withdrawals, compromising the integrity of the bridge.
Tools used: Manual Review.
Recommendations:
Implement a nonce or request hash tracking system to ensure each L1 message is processed only once.
Potential changes:
Add a mapping to store processed request hashes and modify the withdraw_auto_from_l1
function to check if a request has already been processed.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.