A paper [1] in collaboration with Haijun Wang (NTU/Ant Financial), Ye Liu (NTU), Shang-Wei Lin (NTU), Cyrille Artho (KTH), Lei Ma (Kyushu U), and Yang Liu (NTU) was accepted by IEEE TDSC. This paper proposes a fuzz testing approach, ContraMaster, to discover security vulnerabilities in smart contracts, powered by general-purpose semantic test oracles. The empirical evaluation shows that ContraMaster produces much less false positives than existing pattern-based approaches. A quick summary of the paper is given below.
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.
References
- Wang, H., Liu, Y., Li, Y., Lin, S.-W., Artho, C., Ma, L., & Liu, Y. (2022). Oracle-Supported Dynamic Exploit Generation for Smart Contracts. IEEE Transactions on Dependable and Secure Computing, 19(3), 1795–1809.