Static Application Security Testing (SAST) Tools for Smart Contracts: How Far Are We?

Kaixuan Li, Yue Xue, Sen Chen, Han Liu, Kairan Sun, Ming Hu, Haijun Wang, Yang Liu, Yixiang Chen

This paper, recently published in Proceedings of the ACM on Software Engineering (FSE 2024), provides a sobering reality check for the state of smart contract security. By developing a massive new benchmark and a fine-grained taxonomy, the authors reveal that even the best Static Application Security Testing (SAST) tools are currently struggling to keep pace with the complexity of modern blockchain vulnerabilities.

TL;DR

The authors evaluate eight leading SAST tools against a new, massive benchmark of over 10,000 vulnerabilities across 45 distinct types. The results are a wake-up call: current tools miss roughly 50% of vulnerabilities and suffer from extremely low precision (under 10%), meaning developers are often buried in false positives while critical bugs slip through.

What Problem Does This Paper Address?

Smart contracts are "immutable" once deployed and often manage millions in assets, making security paramount. While many SAST tools exist to find bugs before deployment, comparing them has historically been "apples-to-oranges."

Existing evaluations suffer from three main issues:

  1. Outdated Taxonomies: Standards like DASP Top 10 or SWC are either too coarse or include obsolete issues (like "Short Addresses") while missing newer threats.
  2. Small/Biased Benchmarks: Many studies use small datasets or lack "ground truth" (verified labels) at the function level.
  3. Inconsistent Metrics: Evaluations often focus on a subset of metrics, hiding the trade-off between finding every bug (Recall) and not crying wolf (Precision).

Methods

The researchers tackled these gaps through a multi-phase empirical study:

  • A New Taxonomy: They proposed a fine-grained taxonomy of 45 unique vulnerability types categorized into seven areas (Access Control, Arithmetic, Denial of Service, etc.).
  • The Benchmark: They aggregated four existing datasets and added a new BNB Benchmark consisting of 113 real-world industrial projects from BscScan.
  • Manual Ground Truth: In a massive effort totaling 11 person-months, security experts manually labeled 10,394 vulnerabilities at the function level.
  • Tool Selection: They evaluated 8 representative tools: 7 open-source (Securify2, Slither, SmartCheck, Manticore, Mythril, Osiris, Oyente) and one anonymous commercial tool (referred to as "CSA").
  • Multi-dimensional Analysis: Tools were compared based on their rule coverage, effectiveness (Precision/Recall/F1), consistency (how well they work together), and efficiency (execution time).

Datasets

The study utilizes a combined benchmark of 788 smart contract files:

  • Not So Smart Contracts
  • Smartbugs-Curated
  • SolidiFI Benchmark (Known for its large number of injected bugs)
  • Smart Contract Benchmark Suites
  • BNB Benchmark: A newly introduced set of 113 real-world projects with 120 verified vulnerabilities.

Key Insights and Ideas

  • The "Compiler Version" Trap: Many tools (Securify2, Oyente, Osiris) are deeply tied to specific versions of the Solidity compiler. If a contract uses a newer or older version than the tool supports, the tool simply fails to analyze it. SmartCheck was the only tool with a 100% success rate because it uses an ANTLR-based parser rather than the official compiler.
  • Static Analysis (SA) vs. Symbolic Execution (SE): SA tools (like Slither and CSA) are significantly faster and have better recall. SE tools (like Manticore and Mythril) aim for higher precision by simulating execution paths but frequently time out or fail on complex real-world code.
  • Precision is Abysmal: Even the "best" performing tool (CSA) had a precision of only 3.35%. This means for every 100 bugs reported, 96 or 97 are likely false alarms. This "alert fatigue" is a major barrier to developer adoption.
  • The Power of Combination: The authors found that an "inclusive" strategy (flagging a bug if any tool finds it) can reach a 91.5% recall. However, this comes at the cost of flagging nearly 37% more functions as potentially vulnerable, further tanking precision to 2.67%.

Key Results

  • Coverage: The commercial tool CSA (97.8%) and Slither (95.6%) had the most comprehensive rule sets.
  • Effectiveness: CSA achieved the highest F1-score, but it was still only 6.40% (72% Recall, 3.35% Precision). Slither followed with an F1 of 2.38%.
  • Efficiency: Slither and CSA are the speed kings, averaging ~17 seconds per contract. Manticore was the slowest, averaging over 25 minutes per contract.
  • Vulnerability Difficulty: Bugs related to Access Control and Reentrancy are generally easier for tools to detect than Arithmetic or Storage & Memory issues.

Limitations and Future Work

The authors acknowledge that their benchmark is skewed by the SolidiFI dataset, which contains many injected bugs that might not perfectly mirror organic coding errors.

Future Directions: * Hybrid Analysis: Combining the speed of static analysis with the precision of symbolic execution. * Compiler Agnosticism: Developing tools that don't break every time the Solidity compiler is updated. * DeFi Logic: Moving beyond "low-level" bugs to detect complex business logic flaws in DeFi protocols, which current SAST tools almost entirely ignore.

For researchers and developers, this paper serves as a rigorous baseline, suggesting that while we have many tools, we are still a long way from "push-button" security for smart contracts.

Summary updated

BibTeX
@article{li2024static,
  author = {Kaixuan Li and Yue Xue and Sen Chen and Han Liu and Kairan Sun and Ming Hu and Haijun Wang and Yang Liu and Yixiang Chen},
  title = {{Static Application Security Testing (SAST) Tools for Smart Contracts: How Far Are We?}},
  journal = {Proc. ACM Softw. Eng.},
  year = {2024},
  doi = {10.1145/3660772},
}

Loading related content...

Figure