Program Analysis for High-Value Smart Contract Vulnerabilities: Techniques and Insights

Yannis Smaragdakis, Neville Grech, Sifis Lagouvardos, Konstantinos Triantafyllou, Ilias Tsatiris, Yannis Bollanos, Tony Rocco Valentine · 2025

Read Program Analysis for High-Value Smart Contract Vulnerabilities: Techniques and Insights by Yannis Smaragdakis, Neville Grech, Sifis Lagouvardos, Konstantinos Triantafyllou, Ilias Tsatiris, Yannis Bollanos, Tony Rocco Valentine (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-20672.txt.

Introduction

Yannis Smaragdakis and six co-authors explained in 2025 how automated program analysis can find smart contract flaws worth millions, defying a common belief. Many assume such tools catch only shallow, cheap bugs. The team's disclosures earned ten bug bounties worth over three million dollars on live code, plus hundreds of finds in code still under audit. Two ingredients drove the success: near-complete static analysis kept precise enough, and deep domain knowledge.

Some of that knowledge was inferred automatically from statistics over many deployed contracts. The authors argue a useful detector for high-value flaws will flag under one percent of programs. Most flags will be false alarms, perhaps nineteen in twenty. They say that trade is worth it when one true find pays hugely. The paper distills lessons for builders of security tools.

Catalog record

CREATORYannis Smaragdakis, Neville Grech, Sifis Lagouvardos, Konstantinos Triantafyllou, Ilias Tsatiris, Yannis Bollanos, Tony Rocco Valentine
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE49 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2507-20672

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Program Analysis for High-Value Smart Contract Vulnerabilities: Techniques and Insights Yannis Smaragdakis, Neville Grech, Sifis Lagouvardos, Konstantinos Triantafyllou, Ilias Tsatiris, Yannis Bollanos, Tony Rocco Valentine Abstract . A widespread belief in the blockchain security community is that automated techniques are only good for detecting shallow bugs, typically of small value. In this paper, we present the techniques and insights that have led us to repeatable success in automatically discovering high-value smart contract vulnerabilities. Our vulnerability disclosures have yielded 10 bug bounties, for a total of over $3M, over high-profile deployed code, as well as hundreds of bugs detected in pre-deployment or under-audit code. We argue that the elements of this surprising success are a) a very high-completeness static analysis approach that manages to maintain acceptable precision; b) domain knowledge, provided by experts or captured via statistical inference. We present novel techniques for automatically inferring domain knowledge from statistical analysis of a large corpus of deployed contracts, as well as discuss insights on the ideal precision and warning rate of a promising vulnerability detector. In contrast to academic literature in program analysis, which routinely expects false-positive rates below 50% for publishable results, we posit that a useful analysis for high-value real-world vulnerabilities will likely flag very few programs (under 1%) and will do so with a high false-positive rate (e.g., 95%, meaning that only one-of-twenty human inspections will yield an exploitable vulnerability). 1. Introduction Smart contracts—autonomous programs deployed and operating on the blockchain—present a particularly interesting setting for software verification and validation approaches. The reason is stringent correctness requirements, largely arising due to the large and direct impact of possible contract errors. Smart contracts manage monetary assets, often in the many millions or billions of dollars. The most common domain for smart contracts deployed in the past few years has been Decentralized Finance (DeFi), i.e., autonomous protocols that implement many of the functionalities of conventional finance (e.g., lending, exchanging, options trading), often in innovative ways. With this much real-world value, one might expect that cutting-edge research techniques on program analysis and testing would have a significant practical impact on smart contracts. This has arguably not been the case, however. Perez and Livshits 2021 conduct a thorough study of tens of thousands of Ethereum contracts reported vulnerable by six leading academic projects. They find that under 2% of the contracts and only 0.27% of the funds held in them have actually been exploited. A very small part of this impact is explainable by the tools having higher-than-reported false-positive (i.e., imprecision ) rates. Instead, the main reason for this striking result is a strong bias in the sample: contracts that hold funds are very heavily scrutinized and much more likely to be false positives in the analysis. Even analyses with 90% precision (i.e., true-positive) rates, in the overall contract population, have extremely high false-positive rates in the subset of contracts that truly currently manage funds. Therefore, it should come as no surprise that program analysis tools are not considered very valuable for smart contract security analysis. A recent quote (one of many) by a prominent security analyst in the Ethereum space captures the prevailing view: “ for an experienced contract author, it’s never the automated tooling that finds the bugs that kill them ” ( Konstantopoulos 2021 ) . Having a practical impact on deployed contract security via automated techniques seems like a formidable challenge. In this paper, we present the techniques and insights that we have used to meet this challenge. Although human understanding is essential for finding many of the high-value vulnerabilities in deployed smart contracts, our work shows that automated analyses can pinpoint high-value vulnerabilities. The statement is more than a near-trivial existence proof: it is based on repeatable results, that have yielded hundreds of vulnerability reports, as well as ten independent bug bounties, for a total of over $3M, over DeFi protocols managing billions in assets. The technical core of our approach consists of two main parts. The first is symbolic value-flow (symvalic) analysis: a high-precision/high-completeness static analysis approach, whose technical elements are described in detail in a recent publication ( Smaragdakis et al. 2021 ) . The second part is a corpus analysis : a complementary (to the static analysis) statistical analysis of irregular or unusual code patterns, relative to a large number of other deployed smart contracts. An interesting element concerns the interplay of symvalic (i.e., static) analysis and corpus (i.e., statistical) analysis. The vocabulary of the statistical analysis is directly informed by properties established by the static analysis. For instance, a common concept over which anomalous code patterns can be detected is that of tainting : e.g., the combined analysis may ask “can an untrusted user taint (i.e., control) the n -th argument of an external DeFi protocol call in this contract , when that argument is typically determined to be untainted in many other contracts that call the same DeFi protocol?” Finally, we present insights regarding the expected performance metrics of a program analysis for detecting high-value vulnerabilities. We argue that a useful analysis for complex vulnerabilities is unlikely to be very precise in terms of conventional metrics—and that is fine! A false-positive rate of 98% (1 of 50 warnings being truly exploitable) may be prohibitive for a top-tier academic publication, but it is perfectly expected when the domain of evaluation is not controlled benchmarks but actual, deployed, and scrutinized smart contracts. A warning rate of 0.5% (flagging one-of-every-200 contracts for a given vulnerability) may seem entirely unimpactful in terms of a research evaluation of the analysis benefit. (“99.5% of the programs are already correct, what is the need for an analysis to get this number to 100%?”) But reality is quite the opposite: a 0.5% warning rate is entirely in the credible range for high-impact vulnerabilities. 2. Background Static Analysis. Static analysis is distinguished among program analysis techniques (e.g., testing ( Meyer 2008 ; Czech et al. 2016 ) , model checking ( Jhala and Majumdar 2009 ; Clarke et al. 1986 ) , or symbolic execution ( King 1976 ; Baldoni et al. 2018 ) ) by its emphasis on completeness , i.e., its attempt to model all (or, practically, as many as possible) program behaviors. To achieve this goal under a realistic time budget, static analysis often has to sacrifice some precision : the analysis may consider combinations of values that may never appear in a real execution. Maintaining high precision, while achieving completeness and scalability, is a fundamental conceptual challenge. Algorithmic design of static analyses has been trying to address this challenge for several decades, with thousands of different research innovations. All static analysis design is, therefore, an effort to simultaneously achieve as much practical precision and completeness as possible. (The third dimension of analysis quality, scalability can mostly be ignored for the purposes of our presentation: we restrict our attention to algorithms that scale well, i.e., can give results in realistic time frames—e.g., in the hours—under current technology.) Generic definitions for the two terms can only be approximate, but, intuitively: \bullet an analysis is precise to the extent that the program behaviors it predicts are actually possible in program execution; \bullet an analysis is complete to the extent that the

Read the complete text