Skip to content
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

Compromised / hacked #17

Open
mindfulme opened this issue Aug 16, 2021 · 4 comments
Open

Compromised / hacked #17

mindfulme opened this issue Aug 16, 2021 · 4 comments

Comments

@mindfulme
Copy link

function putCurEpochConPubKeyBytes(bytes memory curEpochPkBytes) public whenNotPaused onlyOwner returns (bool) {

@mindfulme
Copy link
Author

This is the attack in detail:

The attacker computed the 32-bit ID for putCurEpochConPubKeyBytes:
ethers.utils.id ('putCurEpochConPubKeyBytes(bytes)').slice(0, 10)'0x41973cd9'

The attacker brute-forced a string that, if set as _method in the code snippet above, gives the same 32-bit value. In this case the attacker used the string “f1121318093”:
ethers.utils.id ('f1121318093(bytes,bytes,uint64)').slice(0, 10)'0x41973cd9'

The attacker called a cross-chain transaction from the Ethereum network to the Poly network by triggering EthCrossChainManager and targeting EthCrossChainData, and passing the string f1121318093 as _method, and the public key of their own Ethereum wallet as a parameter.

This triggered EthCrossChainManager into calling the function putCurEpochConPubKeyBytes within EthCrossChainData, and demanding the attacker’s public key to be registered as a Keeper’s. EthCrossChainData executed such command, since EthCrossChainManager is its owner.

Once the transaction was executed and the attacker was granted the status of Keeper for the Ethereum blockchain, the attacker proceeded into using the corresponding secret key in their possession to funnel tokens out of Poly’s Ethereum wallet into their own wallet.

The attacker repeated the above for other Poly liquidity wallets: Binance, Neo, Tether, etc.

@mindfulme
Copy link
Author

Fix: remove ownership from https://github.com/polynetwork/eth-contracts/blob/d16252b2b857eecf8e558bd3e1f3bb14cff30e9b/contracts/core/cross_chain_manager/logic/EthCrossChainManager.sol over EthCrossChainData.sol contract, use multi sig instead

@mindfulme mindfulme changed the title Compromised Compromised / hacked Aug 16, 2021
@Walidhossain010
Copy link

is it a valid bug on poly network?? were you able to exploit?

@stevenli6186
Copy link

is it a valid bug on poly network?? were you able to exploit?

It was in the news on Aug 10th :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants