The signature issued by operator, can be replayed. Attacker can execute same signed signature multiple time.
The sendToL1 function lacks proper measures to prevent the reuse of signatures, making it vulnerable to replay attacks. Attackers can execute the same signed signature multiple times.
The attacker can drain all funds from the vault by repeatedly executing the malicious transaction.
Given:
Alice has 1000 tokens
.
Bob has 3000 tokens
.
Alice deposits 1000 tokens
with depositTokensToL2()
.
The bridge operator signs a withdrawal request to Alice.
Alice withdraws tokens with the operator's signature.
Bob deposits 3000 tokens
with depositTokensToL2()
.
Before Bob withdraws tokens, Alice can replay the same signature three times to obtain all tokens.
Result: The tokens from the vault have now been stolen, and Alice now has 4000 tokens.
Insert this test in L1TokenBridge.t.sol
Manual Review
Add nonce or timestamp in the signed data
Ensure that used signatures cannot be reused
Create a mapping to keep track of used signatures
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.