TL;DR
This paper introduces MoE, a novel framework for real-time detection of diverse Ethereum transaction-level attacks. By combining a flexible attack modeling language with a unique semantic lifting approach and quantitative analysis, MoE significantly improves attack detection accuracy and recall while maintaining high efficiency.
What Problem Does This Paper Address?
The explosive growth of decentralized applications (DApps) on platforms like Ethereum has unfortunately made them a prime target for malicious actors. Existing methods for detecting these attacks often rely on rigid, pre-defined rules or overly specialized models. This approach struggles to keep pace with the ever-evolving landscape of attack vectors, which are often dynamic and diverse. These attacks, such as call injection and sandwich attacks, exploit vulnerabilities at the transaction level, bypassing traditional code-level security checks and leading to significant financial losses. The paper aims to bridge this gap by providing a general, extensible, and efficient solution for identifying a wide spectrum of these sophisticated attacks.
Methods
The core of MoE is built upon three key stages:
- Transaction Tracing: This stage involves instrumenting the Ethereum Virtual Machine (EVM) to capture detailed system logs generated during transaction execution. This provides the raw data needed for subsequent analysis.
- Semantic Lifting: This is a novel approach where raw transaction logs are transformed into "semantic logs." This process extracts crucial system behaviors and translates them into a format that can be understood by monitoring tools. This lifting is designed to be flexible, allowing for the extraction of information relevant to various attack types.
- Attack Detection: The semantic logs are then fed into the MONPOLY runtime monitoring engine. MoE utilizes Metric First-order Temporal Logic (MFOTL) to formally model various attack patterns. A key innovation here is the integration of quantitative capabilities. This allows MoE to not only detect exact matches to attack formulas but also to evaluate the "similarity" or "robustness" of a transaction to an attack pattern, enabling the identification of near-miss attacks.
Datasets
- Labeled Benchmark (D1): This dataset consists of 24 documented attacks, expanded from a previous benchmark and augmented with real-world incidents from May 2020 to June 2022. It's used for validating MoE's accuracy against known attack patterns.
- Large-Scale Dataset (D2): This dataset comprises 1,064,996 unlabeled transactions collected from 59 high-volume DApps (e.g., Value Defi, Uniswap) between May 2020 and June 2022. This dataset is crucial for evaluating MoE's performance, efficiency, and scalability in a real-world, unlabelled environment.
Key Insights and Ideas
- Unified Attack Modeling: The use of MFOTL provides a powerful and unified way to formalize a wide range of transaction-level attacks, moving beyond specialized detectors.
- Semantic Lifting for Abstraction: The semantic lifting approach is critical for bridging the gap between raw, low-level transaction data and the high-level behaviors that characterize attacks, making monitoring feasible.
- Quantitative Analysis for Near-Misses: The most significant insight is the introduction of quantitative semantics. This allows MoE to detect attacks that are not exact matches to predefined formulas but exhibit strong similarities, significantly improving detection of evolving threats and near-misses.
- Efficiency for Real-Time: The framework is designed for speed, with average monitoring times well below transaction execution times, making it suitable for real-time detection.
Key Results
- Labeled Benchmark (D1): MoE successfully detected 92.0% of attacks, achieving a 45.0% higher recall rate compared to a state-of-the-art tool (DeFiWarder).
- Large-Scale Dataset (D2): MoE identified 3,319 attack transactions with a precision of 95.4%. These detected attacks were associated with a financial loss of over 118 million USD, many of which had gone unnoticed.
- Quantitative Advantage: The quantitative analysis capability uncovered an additional 8% more attacks compared to a non-quantitative approach.
- Efficiency: The average time to monitor a single transaction is less than 23 ms, demonstrating its suitability for real-time applications.
Limitations and Future Work
- Threshold Tuning: The paper notes that optimal performance for quantitative analysis requires tuning thresholds for different attack types.
- Complex Attacks: While MoE handles a wide range, some highly complex or novel attacks might require more sophisticated behavioral information, potentially increasing overhead.
- Future Work: The authors suggest that the quantitative capabilities of MoE could pave the way for future runtime enforcement mechanisms, allowing for proactive prevention of attacks. Further research could also focus on extending the framework to detect an even broader range of emerging threats.
Summary updated