Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Replay Tx on another Chain #687

Closed
summerpro opened this issue Jan 6, 2021 · 2 comments · Fixed by okx/exchain#544
Closed

Replay Tx on another Chain #687

summerpro opened this issue Jan 6, 2021 · 2 comments · Fixed by okx/exchain#544
Labels
stale stale PRs that will be closed if no further action occurs

Comments

@summerpro
Copy link
Contributor

summerpro commented Jan 6, 2021

Vulnerability Overview:

Since ethermint uses the same type of chainIDEpoch for ethereum compatibility, a verified signature in ethereum is still valid in ethermint with the same msg content and chainIDEpoch, which enables "cross-chain transaction replay" attack etc.

Details and Root Cause:

First, we found some ground truths:

  1. Both ethermint and ethereum have the same signature scheme.
  2. User has the same public key and private key on ethermint and ethereum.
  3. Different chainID can be parsed to a same chainIDEpoch such as "ethereum-1" and "erhermint-1"

Thus, if a msg successfully executed on ethereum of some chainIDEpoch, say 1 (mainnet), then it can be replaied on ethermint of the same chainIDEpoch (with the nonce check passed), and vice versa.

Steps to Exploit:

  1. Suppose that there are two chains. One's chainID is "Ethereum-1",the other is "Ethermint-1".The victim have accounts on both chains with the same public key (private key).
  2. The victim transfer 10eth to the attacker,and the victim's MsgEthereumTx.data.nonce on "Ethereum-1" is 300. The victim's MsgEthereumTx.data.nonce on "Ethermint-1" is 300(or less than 300).For the previously mentioned vulnerability can greatly reduce the difficulty of exploiting this vulnerability only need to meet the nonce of the replayed chain than the nonce of the replayed chain can be low.
  3. The attacker replay the MsgEthereumTx on "Ethermint-1".
@summerpro
Copy link
Contributor Author

Credit to: OKLink & Chaitin Tech

@github-actions
Copy link

github-actions bot commented Apr 9, 2021

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale stale PRs that will be closed if no further action occurs label Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale stale PRs that will be closed if no further action occurs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants