[Paper Review] Oracle-Supported Dynamic Exploit Generation for Smart Contracts
This paper proposes ContraMaster, a dynamic, oracle-supported framework for generating exploitable smart contract vulnerabilities by mutating transaction sequences and monitoring semantic inconsistencies via a general-purpose test oracle. It outperforms state-of-the-art techniques by detecting all 28 exploitable vulnerabilities in 218 benchmark contracts with zero false positives and uncovering three novel attack patterns.
Despite the high stakes involved in smart contracts, they are often developed in an undisciplined manner, leaving the security and reliability of blockchain transactions at risk. In this paper, we introduce ContraMaster: an oracle-supported dynamic exploit generation framework for smart contracts. Existing approaches mutate only single transactions; ContraMaster exceeds these by mutating the transaction sequences. ContraMaster uses data-flow, control-flow, and the dynamic contract state to guide its mutations. It then monitors the executions of target contract programs, and validates the results against a general-purpose semantic test oracle to discover vulnerabilities. Being a dynamic technique, it guarantees that each discovered vulnerability is a violation of the test oracle and is able to generate the attack script to exploit this vulnerability. In contrast to rule-based approaches, ContraMaster has not shown any false positives, and it easily generalizes to unknown types of vulnerabilities (e.g., logic errors). We evaluate ContraMaster on 218 vulnerable smart contracts. The experimental results confirm its practical applicability and advantages over the state-of-the-art techniques, and also reveal three new types of attacks.
Motivation & Objective
- To address the high rate of false positives in static, rule-based smart contract vulnerability detection by shifting to dynamic analysis grounded in runtime semantics.
- To develop a general-purpose semantic test oracle that captures fundamental invariants in contract behavior, such as fund consistency and state integrity.
- To design a grey-box fuzzer that mutates not only function inputs but also transaction sequences, gas limits, fallback functions, and contract states to improve exploitability discovery.
- To validate the framework on real-world vulnerable contracts and demonstrate its superiority over existing tools in detecting only exploitable vulnerabilities.
- To identify previously unknown vulnerability patterns by observing semantic mismatches between external events and internal contract states.
Proposed method
- ContraMaster employs a general-purpose semantic test oracle that checks for inconsistencies between externally observable events (e.g., fund transfers) and internal contract states (e.g., balance bookkeeping).
- It uses a grey-box fuzzing engine enhanced with custom mutation operators targeting transaction sequences, gas limits, fallback functions, and dynamic contract states.
- Feedback mechanisms are derived from data-flow, control-flow, and runtime contract state analysis to guide mutation toward deeper code coverage and vulnerability exposure.
- The framework executes transactions in a realistic EVM environment and validates results against the semantic oracle to ensure each detected vulnerability is exploitable.
- It leverages runtime monitoring to detect semantic mismatches indicative of vulnerabilities such as reentrancy, exception disorder, and integer overflow/underflow.
- The approach generalizes across vulnerability types without requiring prior pattern definitions, enabling detection of unknown attack vectors.
Experimental results
Research questions
- RQ1Can a general-purpose semantic test oracle effectively detect a broad range of smart contract vulnerabilities without relying on predefined syntactic patterns?
- RQ2To what extent does mutating transaction sequences improve the detection of exploitable vulnerabilities compared to single-transaction mutation?
- RQ3How effective is ContraMaster in reducing false positives compared to existing rule-based and static analysis techniques?
- RQ4What novel vulnerability patterns can be discovered through dynamic, oracle-guided mutation of contract execution sequences?
- RQ5Can the framework detect and reproduce real-world exploits with high fidelity in a production-like environment?
Key findings
- ContraMaster evaluated on 218 vulnerable smart contracts detected 28 exploitable vulnerabilities, all of which were confirmed as valid and reproducible with attack scripts.
- Of the 218 reported vulnerabilities, 87.16% (189) were non-exploitable, highlighting the high false positive rate of existing rule-based tools.
- ContraMaster achieved zero false positives across all test cases, outperforming state-of-the-art tools like ContractFuzzer and Zeus.
- The framework discovered 26 previously unknown vulnerabilities, including three new types of attacks not covered by existing vulnerability patterns.
- The semantic test oracle successfully identified exploitable flaws by detecting semantic mismatches between external events and internal contract states.
- Customized mutation operators targeting transaction sequences and contract states significantly improved the effectiveness of exploit generation compared to traditional fuzzing.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.