-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the event of a hardfork, IncentivizedMockImplementation is susceptible to cross-chain signature replay #69
Comments
Cross-chain applications aren't durable for hardforks. It is assumed that only 1 instance of cross-chain application will continue working, whatever instance that the AMB determines to be canonical. When that is done, it is very likely that the non-canonical chain will freeze: Messages won't be submitted, checks against chain.id freezes, and much more. We could try to build defences into the application but it is much simpler to ignore the new fork. If it becomes relevant, then everything can be redeployed to ensure the deployment isn't accidently broken. So far, I have yet to see a sustainable hard fork. Cons associated with the proposed fix: Verifying the message becomes 2000 gas more expensive. As such, hard coding the chainid is (from my perspective) a better fix. |
The new chain instance that continues to work is fine, but chain support after a hardfork does not go away instantly for the old one either (check out ETH vs ETC). |
We have decided to classify this issue as won't fix. Our decision is based on the following arguments:
According to these arguments, the issue is won’t fix. |
I still sit behind my argument in #72 that non-EVM chains do not sufficiently cover the concept of |
I don't understand this argument. Could you please propose a fix / PoC or similar? |
The fix is straightforward, replace the UNIQUE_SOURCE_IDENTFIER and chainId parameters with the built-in wormhole constants for different EVM and non-EVM chains (since the protocol intends to support both). Normally the difference between 2 identical messages on 2 chains would be the chainId(). |
We have classified this as won't fix. |
Github username: @PlamenTSV
Twitter username: @p_tsanev
Submission hash (on-chain): 0xa099d3d13dfa2619ab793bf91a79614b1f71b35c5be5b169264a17ed98f580bb
Severity: medium
Description:
Description
Both the incentivized mock and wormhole implementation implement methods to send, sign and verify packets of messages. Messages which, upon submission, get signed by the owner/signer of the implementation against their identifiers which include: block number, destination identifier and the message itself, as well as a chainId(on the wormhole) or a SOURCE_IDENTIFIER(on the mock). Due to the SOURCE_IDENTIFIER being hardcoded, with no method to alter it, a hardfork of the chain would leave the contract open for cross-chain replay of old messages.
Attack Scenario
A hardfork/split in the word software and blockchains is described as "...a protocol software upgrade that permanently splits a blockchain network into two separate chains. It occurs when nodes on the newest version of the protocol fail to accept the older version of the blockchain."
It an unusual occurence that leads to the seperation of the chain at a given block, producing 2 different block-chains.
The Wormhole implementation would suffer no change, because it uses
chainId()
to encode identifiers, which changes with forks. Unlike it however, the SOURCE_IDENTIFIER does not change, so identical messages on the 2 different chains would be signed with the same parameters, leading to the same metadata, that later decoded would approve the signature on both chains, allowing the messages to be replayed cross-chain.Hardforks are often unpredictable events, and their occurence/likelihood could either low or medium depending on the future EIPs, but the impact is definitely high, thus - MEDIUM
More on previous hardforks, solidifying their unpredictiveness and inevitable occurence with more incoming EIPs: https://coinloan.io/blog/history-of-ethereum-hard-forks/
Historical issues with signatures:
https://solodit.xyz/issues/m-05-replay-attack-in-case-of-hard-fork-code4rena-golom-golom-contest-git
https://solodit.xyz/issues/m-24-oracles-are-vulnerable-to-cross-chain-replay-attacks-sherlock-none-gmx-git
Attachments
Recommendation: add an admin function for changing the SOURCE_IDENTIFIER in the mock or just use chainId() like on wormhole, as it is foulproof.
The text was updated successfully, but these errors were encountered: