Beginner FriendlyFoundryBridge
100 EXP
View results
Submission Details
Severity: high
Invalid

Signature replay attack on a different chain is possible

Summary

Signature replay attack is possible across different chains and cause loss of funds for the protocol.

Vulnerability Details

Since the message encoded by the user & then signed by the operator does not include a chainId, once the message has been signed, the message & the v, r, s params can be re-used by the user to withdraw funds on a different chain. The check here fails to protect against it.

Impact

Loss of funds for the protocol.

Tools Used

Manual inspection.

Recommendations

Include a chain id when operator is signing the message off-chain. Also, include it inside withdrawTokensToL1():

function withdrawTokensToL1(address to, uint256 amount, uint8 v, bytes32 r, bytes32 s) external {
+ uint256 chainID;
+ assembly {
+ chainID := chainid()
+ }
sendToL1(
v,
r,
s,
abi.encode(
address(token),
+ chainID,
0, // value
abi.encodeCall(IERC20.transferFrom, (address(vault), to, amount))
)
);
}
Updates

Lead Judging Commences

0xnevi Lead Judge
about 2 years ago
0xnevi Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.