{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,1]],"date-time":"2026-07-01T03:12:44Z","timestamp":1782875564604,"version":"3.54.5"},"reference-count":35,"publisher":"Association for Computing Machinery (ACM)","issue":"ISSTA","funder":[{"DOI":"10.13039\/501100003725","name":"National Research Foundation of Korea","doi-asserted-by":"publisher","award":["RS-2022-NR119707, RS-2024-00337007"],"award-info":[{"award-number":["RS-2022-NR119707, RS-2024-00337007"]}],"id":[{"id":"10.13039\/501100003725","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Proc. ACM Softw. Eng."],"published-print":{"date-parts":[[2025,6,22]]},"abstract":"<jats:p>Decentralized Finance (DeFi) enables many novel applications that were impossible in traditional finances. However, it also introduces new types of vulnerabilities. An example of such vulnerabilities is a composability bug between token contracts and Decentralized Exchange (DEX) that follows the Constant Product Market Maker (CPMM) model. This type of bug, which we refer to as CPMM composability bug, originates from issues in token contracts that make them incompatible with CPMMs, thereby endangering other tokens within the CPMM ecosystem. Since 2022, 23 exploits of such kind have resulted in a total loss of 2.2M USD. BlockSec, a smart contract auditing company, reported that 138 exploits of such kind occurred just in February 2023.<\/jats:p>\n          <jats:p>In this paper, we propose CPMMX , a tool that automatically detects CPMM composability bugs across  \nentire blockchains. To achieve such scalability, we first formalized CPMM composability bugs and found that these bugs can be induced by breaking two safety invariants. Based on this finding, we designed CPMMX equipped with a two-step approach, called shallow-then-deep search. In more detail, it first uses shallow search to find transactions that break the invariants. Then, it uses deep search to refine these transactions, making them profitable for the attacker. We evaluated CPMMX against five baselines on two public datasets and one synthetic dataset. In our evaluation, CPMMX detected 2.5x to 1.5x more vulnerabilities compared to baseline methods. It also analyzed contracts significantly faster, achieving higher F1 scores than the baselines. Additionally, we applied CPMMX to all contracts on the latest blocks of the Ethereum and Binance networks and discovered 26 new exploits that can result in 15.7K USD profit in total.<\/jats:p>","DOI":"10.1145\/3728872","type":"journal-article","created":{"date-parts":[[2025,6,22]],"date-time":"2025-06-22T10:52:56Z","timestamp":1750589576000},"page":"47-68","source":"Crossref","is-referenced-by-count":1,"title":["Automated Attack Synthesis for Constant Product Market Makers"],"prefix":"10.1145","volume":"2","author":[{"ORCID":"https:\/\/orcid.org\/0000-0002-4361-9781","authenticated-orcid":false,"given":"Sujin","family":"Han","sequence":"first","affiliation":[{"name":"KAIST, Daejeon, Republic of Korea"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0006-0394-3532","authenticated-orcid":false,"given":"Jinseo","family":"Kim","sequence":"additional","affiliation":[{"name":"KAIST, Daejeon, Republic of Korea"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5518-2126","authenticated-orcid":false,"given":"Sung-Ju","family":"Lee","sequence":"additional","affiliation":[{"name":"KAIST, Daejeon, Republic of Korea"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8931-2833","authenticated-orcid":false,"given":"Insu","family":"Yun","sequence":"additional","affiliation":[{"name":"KAIST, Daejeon, Republic of Korea"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"320","published-online":{"date-parts":[[2025,6,22]]},"reference":[{"key":"e_1_2_1_1_1","unstructured":"2024. BscScan: The Binance Smart Chain Explorer. https:\/\/bscscan.com\/ Accessed: 2024-10-24"},{"key":"e_1_2_1_2_1","unstructured":"2024. Etherscan: The Ethereum Blockchain Explorer. https:\/\/etherscan.io\/ Accessed: 2024-10-24"},{"key":"e_1_2_1_3_1","unstructured":"Hayden Adams Noah Zinsmeister and Dan Robinson. 2021. Uniswap Protocol Whitepaper. https:\/\/docs.uniswap.org\/whitepaper.pdf Accessed: 2024-10-24"},{"key":"e_1_2_1_4_1","unstructured":"Ancilia Inc.. 2022. Blockchain Security for Web3 Developers. https:\/\/x.com\/AnciliaInc\/status\/1557846766682140672 Accessed: 2024-10-16"},{"key":"e_1_2_1_5_1","doi-asserted-by":"publisher","DOI":"10.1109\/SP46215.2023.10179346"},{"key":"e_1_2_1_6_1","unstructured":"BlockSec. 2023. BlockSec Twitter. https:\/\/twitter.com\/BlockSecTeam\/status\/1624077078852210691"},{"key":"e_1_2_1_7_1","unstructured":"BlockSec. 2024. BlockSec. https:\/\/blocksec.com\/"},{"key":"e_1_2_1_8_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3639173"},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3639190"},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/3660786"},{"key":"e_1_2_1_11_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE51524.2021.9678888"},{"key":"e_1_2_1_12_1","unstructured":"DeFiHackLabs. 2020. DeFiHackLabs. https:\/\/github.com\/SunWeb3Sec\/DeFiHackLabs GitHub repository"},{"key":"e_1_2_1_13_1","doi-asserted-by":"publisher","DOI":"10.1109\/wetseb.2019.00008"},{"key":"e_1_2_1_14_1","unstructured":"Foundry. 2024. Foundry. https:\/\/github.com\/foundry-rs\/foundry GitHub repository"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICSE48619.2023.00087"},{"key":"e_1_2_1_16_1","unstructured":"Google. 2024. American Fuzzy Lop (AFL) - A security-oriented fuzzer. https:\/\/github.com\/google\/AFL Accessed: 2024-10-24"},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/3395363.3404366"},{"key":"e_1_2_1_18_1","volume-title":"Confusum Contractum: Confused Deputy Vulnerabilities in Ethereum Smart Contracts. In 32nd USENIX Security Symposium (USENIX Security 23)","author":"Gritti Fabio","year":"2023","unstructured":"Fabio Gritti, Nicola Ruaro, Robert McLaughlin, Priyanka Bose, Dipanjan Das, Ilya Grishchenko, Christopher Kruegel, and Giovanni Vigna. 2023. Confusum Contractum: Confused Deputy Vulnerabilities in Ethereum Smart Contracts. In 32nd USENIX Security Symposium (USENIX Security 23). 1793\u20131810. https:\/\/www.usenix.org\/conference\/usenixsecurity23\/presentation\/gritti"},{"key":"e_1_2_1_19_1","doi-asserted-by":"publisher","DOI":"10.5281\/zenodo.15223116"},{"key":"e_1_2_1_20_1","volume-title":"CPMMX: Automatic Attack Synthesis for Constant Product Market Makers. https:\/\/github.com\/kaist-hacking\/CPMMX Accessed: 2025-04-09","year":"2025","unstructured":"kaist-hacking. 2025. CPMMX: Automatic Attack Synthesis for Constant Product Market Makers. https:\/\/github.com\/kaist-hacking\/CPMMX Accessed: 2025-04-09"},{"key":"e_1_2_1_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597926.3598124"},{"key":"e_1_2_1_22_1","unstructured":"Shaun Paul Lee. 2023. Market Share of Decentralized Crypto Exchanges by Trading Volume. https:\/\/www.coingecko.com\/research\/publications\/decentralized-crypto-exchanges-market-share"},{"key":"e_1_2_1_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/3533767.3534222"},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3639213"},{"key":"e_1_2_1_25_1","doi-asserted-by":"publisher","DOI":"10.1109\/ASE.2019.00133"},{"key":"e_1_2_1_26_1","unstructured":"Neptune Mutual. 2023. How Was BRA Token Exploited? https:\/\/medium.com\/neptune-mutual\/how-was-bra-token-exploited-24ff323249d"},{"key":"e_1_2_1_27_1","unstructured":"Mythril. 2017. Mythril. https:\/\/github.com\/Consensys\/mythril GitHub repository"},{"key":"e_1_2_1_28_1","unstructured":"QuilAudits. 2022. ShadowFi $301K Burn function Exploit Analysis|QuilAudits. https:\/\/medium.com\/quillhash\/shadowfi-301k-burn-function-exploit-analysis-quillaudits-45a17ce04193"},{"key":"e_1_2_1_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597926.3598059"},{"key":"e_1_2_1_30_1","doi-asserted-by":"publisher","DOI":"10.1145\/3597503.3639117"},{"key":"e_1_2_1_31_1","unstructured":"SunWeb3Sec. 2023. BIGFI_exp.sol: DeFi Hack Labs Exploit Test Script. https:\/\/github.com\/SunWeb3Sec\/DeFiHackLabs\/blob\/main\/src\/test\/2023-03\/BIGFI_exp.sol Accessed: 2024-10-24"},{"key":"e_1_2_1_32_1","doi-asserted-by":"publisher","DOI":"10.1109\/TDSC.2022.3182373"},{"key":"e_1_2_1_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3650212.3680321"},{"key":"e_1_2_1_34_1","doi-asserted-by":"publisher","DOI":"10.1109\/SANER48275.2020.9054822"},{"key":"e_1_2_1_35_1","volume-title":"32nd USENIX Security Symposium (USENIX Security 23)","author":"Zhang Zhuo","year":"2023","unstructured":"Zhuo Zhang, Zhiqiang Lin, Marcelo Morales, Xiangyu Zhang, and Kaiyuan Zhang. 2023. Your Exploit is Mine: Instantly Synthesizing Counterattack Smart Contract. In 32nd USENIX Security Symposium (USENIX Security 23). 1757\u20131774. https:\/\/www.usenix.org\/conference\/usenixsecurity23\/presentation\/zhang-zhuo-exploit"}],"container-title":["Proceedings of the ACM on Software Engineering"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3728872","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,7,16]],"date-time":"2025-07-16T16:54:36Z","timestamp":1752684876000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3728872"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,6,22]]},"references-count":35,"journal-issue":{"issue":"ISSTA","published-print":{"date-parts":[[2025,6,22]]}},"alternative-id":["10.1145\/3728872"],"URL":"https:\/\/doi.org\/10.1145\/3728872","relation":{},"ISSN":["2994-970X"],"issn-type":[{"value":"2994-970X","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,6,22]]}}}