-
Notifications
You must be signed in to change notification settings - Fork 12
usmannk - p2p signatures are not unique per chain #125
Description
usmannk
medium
p2p signatures are not unique per chain
Summary
Signed L2 blocks can be gossiped on the p2p network for any chain.
Vulnerability Detail
Signed L2 blocks are meant to use the L2 Chain ID to create p2p signatures unique to each chain.
However, the actual signing code clobbers the chain ID section with the payload hash
msgInput[32:64]
is filled with the chain ID and then immediately overwritten. The intended behavior is described in a comment on line 35.
Impact
Blocks signed for one chain id can be injected into the p2p pool on another, where nodes will ingest and attempt to append them to the chain. This will generally fail due to block number or parent root hash mismatch, but causes unnecessary network load and is a DoS vector.
Code Snippet
Tool used
Manual Review
Recommendation
Fix the SigningHash
function such that the payload hash is placed into the third 32 bytes of msgInput
.
Duplicate of #67