Phantom Events: Demystifying the Issues of Log Forgery in Blockchain

Yixuan Liu, Yuxin Dong, Ye Liu, Xiapu Luo, Yi LiarXiv 2025 · DOI · arXiv

Abstract

Blockchain applications, including wallets, explorers, and cross-chain bridges, frequently rely on transaction logs (events) to synchronize off-chain states with on-chain activities. This paper identifies a critical vulnerability class termed Phantom Events, where attackers forge these logs to deceive off-chain systems. We present PEVENTCATCHER, a multi-layered detection framework that utilizes bytecode analysis and symbolic execution to identify log forgery. Our evaluation reveals over 1.2 million phantom events on the Binance Smart Chain and demonstrates the tool's efficacy in identifying high-profile exploits like the pNetwork hack.

The Problem: The Trust Gap in Blockchain Logs

In the decentralized ecosystem, transaction logs are often treated as an immutable record of truth. However, while the blockchain ensures the integrity of the log's existence, it does not inherently validate the semantic correctness or the authorization of the event's emitter. Off-chain applications like MetaMask or BscScan listen for specific event signatures (e.g., Transfer) to update user balances without re-executing the underlying transactions.

Attackers exploit this "blind trust" by deploying malicious contracts that emit "Phantom Events"—logs that mimic legitimate activity but lack corresponding state changes. For instance, an attacker can trigger a Deposit event without locking assets, tricking a cross-chain bridge into releasing funds on a destination chain.

Sequence diagram of a Phantom Event attack where a malicious contract tricks an off-chain relayer.

Methodology: PEVENTCATCHER

To systematically detect these vulnerabilities, we developed PEVENTCATCHER, which operates across three levels of analysis:

  1. Transaction-Level Analysis: Identifies "Blended Event Attacks" by monitoring on-chain data for transactions where malicious and legitimate contracts interact to obscure fake logs.
  2. Bytecode-Level Analysis: Uses the Gigahorse framework to decompile bytecode into an Intermediate Representation (IR). It performs backward taint analysis to ensure event parameters are derived from authorized sources and protected by proper access controls.
  3. Source-Level Symbolic Execution: For contracts with available source code, the tool uses Slither and the Z3 solver to detect "Event Counterfeiting." This occurs when different execution paths can emit identical event signatures under overlapping constraints, making them indistinguishable to validators.
The multi-layered architecture of PEVENTCATCHER, combining transaction, bytecode, and source-level analysis.

Key Insights and Results

Our research highlights a significant taxonomy of forgery, including Inconsistent Logging and Contract Imitation. A notable case study is the $12.7 million pNetwork hack, which we identified as a "Blended Event Attack" where malicious logs were processed alongside authentic ones.

Experimental Findings

  • High Precision: PEVENTCATCHER achieved a 90.83% precision and 86.51% recall in detecting Event Counterfeiting, significantly outperforming existing tools like XGuard and SmartAxe.
  • Scale of Forgery: We discovered over 1.2 million phantom events on the Binance Smart Chain (BSC) originating from just nine suspicious addresses.
  • Real-World Impact: Our findings led to six confirmed wallet fixes and vulnerabilities identified in major cross-chain bridges, earning bug bounties and preventing further exploits.

Conclusion

The prevalence of Phantom Events underscores a fundamental mismatch between on-chain execution and off-chain interpretation. PEVENTCATCHER provides a robust framework for securing the blockchain ecosystem by bridging this trust gap. Future work will focus on improving symbolic execution for complex multi-contract logic and addressing compiler-related analysis limitations.

Summary updated

BibTeX
@misc{liu2025phantom,
  author = {Yixuan Liu and Yuxin Dong and Ye Liu and Xiapu Luo and Yi Li},
  title = {{Phantom Events: Demystifying the Issues of Log Forgery in Blockchain}},
  year = {2025},
  eprint = {2502.13513},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.13513},
}
Figure