Poly Network was attacked by a Hacker: Contract vulnerability led to the keeper being tampered with.

robot
Abstract generation in progress

Analysis of the Poly Network Hacker Attack Incident

Recently, the cross-chain interoperability protocol Poly Network was attacked by a Hacker, drawing widespread attention. After in-depth analysis by the security team, it was found that the attacker did not implement the attack through the leakage of the keeper's private key, but instead exploited a vulnerability in the contract.

Attack Principles

The core of the attack lies in the EthCrossChainManager contract's verifyHeaderAndExecuteTx function, which can execute specific cross-chain transactions through the _executeCrossChainTx function. Since the owner of the EthCrossChainData contract is the EthCrossChainManager contract, the latter can call the former's putCurEpochConPubKeyBytes function to modify the contract's keeper.

The attacker passed carefully crafted data to the verifyHeaderAndExecuteTx function, causing the _executeCrossChainTx function to call the putCurEpochConPubKeyBytes function of the EthCrossChainData contract, thereby changing the keeper role to an address specified by the attacker. After the keeper role replacement is completed, the attacker can arbitrarily construct transactions and withdraw any amount of funds from the contract.

Attack Process

  1. The attacker first called the putCurEpochConPubKeyBytes function through the verifyHeaderAndExecuteTx function of the EthCrossChainManager contract to change the keeper.

  2. Subsequently, the attacker leveraged the modified permissions to carry out a series of attack transactions, extracting funds from the contract.

  3. Due to the modification of the keeper, the normal transactions of other users were rejected.

  4. This attack pattern has occurred not only on the BSC chain but also on the Ethereum network, which has encountered similar attacks.

Conclusion

The fundamental cause of this attack incident lies in the fact that the keeper of the EthCrossChainData contract can be modified by the EthCrossChainManager contract, and the verifyHeaderAndExecuteTx function of the EthCrossChainManager contract can execute user-input data through the _executeCrossChainTx function. The attacker exploited this design flaw by constructing specific data to modify the keeper of the EthCrossChainData contract, thereby achieving fund theft.

This event once again highlights the importance of security design in cross-chain protocols, especially the need for stricter audits and restrictions in permission management and function calls. For decentralized finance projects, continuous security audits and vulnerability fixes are crucial to prevent similar attack incidents.

View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • 6
  • Repost
  • Share
Comment
0/400
PanicSeller69vip
· 08-12 04:32
How can there still be vulnerabilities in DeFi?
View OriginalReply0
BearMarketNoodlervip
· 08-11 11:12
Another victim Freebie tutorial warning
View OriginalReply0
HodlKumamonvip
· 08-10 15:50
Ahhh, why is the QA audit done so poorly~
View OriginalReply0
AirdropATMvip
· 08-10 15:49
Contract vulnerabilities are really annoying.
View OriginalReply0
TokenCreatorOPvip
· 08-10 15:46
Got liquidated again?
View OriginalReply0
PoolJumpervip
· 08-10 15:31
After being plucked so much wool, the contract still dares to talk about vulnerabilities?
View OriginalReply0
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)