SmartAxe: Detecting Cross-Chain Vulnerabilities in Bridge Smart Contracts via Fine-Grained Static Analysis

Zeqin Liao, Yuhong Nan, Henglong Liang, Sicheng Hao, Juan Zhai, Jiajing Wu, Zibin Zheng

TL;DR

SmartAxe is the first static analysis framework specifically designed to detect Cross-Chain Vulnerabilities (CCVs) in blockchain bridge smart contracts. By modeling heterogeneous access control and constructing specialized cross-chain data-flow graphs, it identified 232 previously unknown vulnerabilities in real-world applications, protecting digital assets worth nearly $1.9 million.

What Problem Does This Paper Address?

As the blockchain ecosystem fragments into multiple platforms (Ethereum, BNB, EOSIO), "cross-chain bridges" have become critical infrastructure for moving assets between them. However, these bridges are high-value targets; a single vulnerability in the PolyNetwork bridge, for instance, led to a $600 million loss.

The authors identify two primary gaps in current security tools:

  1. Heterogeneous Access Control: Unlike standard contracts, bridges use highly diverse and non-standard security checks (e.g., comparing balances before and after a deposit or checking liquidity thresholds). Existing tools fail to recognize these varied patterns.
  2. Cross-Bridge Semantic Inconsistency: Vulnerabilities often arise from a "lost in translation" effect between the source and destination chains. For example, a bridge might correctly lock an ERC-20 token on Chain A but incorrectly credit the user with more valuable ETH on Chain B due to a parsing error. Traditional tools only analyze one contract at a time and miss these multi-chain logic errors.

Methods

SmartAxe introduces a multi-stage pipeline to perform fine-grained static analysis on contract bytecode:

  • Canonical Security Modeling: To handle the "messiness" of different bridge implementations, SmartAxe normalizes diverse security checks into a canonical form. It categorizes checks into three workflows: asset deposit, cross-chain routing, and asset withdrawal.
  • Probabilistic Pattern Inference: Linking a specific resource (like a withdrawal function) to its required security check is complex. SmartAxe uses a probabilistic model to associate resources with checks based on control-flow and data-flow dependencies, allowing it to spot when a critical check is missing.
  • Cross-Chain Graphs (xCFG & xDFG): This is the framework's "secret sauce." SmartAxe aligns the control-flow and data-flow between the two sides of a bridge. It links the "event emission" on the source chain to the "event parsing" on the destination chain, creating a unified graph that tracks how data moves across the entire bridge architecture.
  • Taint Analysis: Finally, it uses taint propagation to determine if an external attacker can reach these vulnerable functions and manipulate state variables.

Datasets

The researchers evaluated SmartAxe using two primary datasets:

  1. $D_{manual}$: A ground-truth dataset of 88 known CCVs collected from 16 real-world bridge applications (comprising 203 smart contracts).
  2. $D_{large}$: A massive "in the wild" dataset containing 1,703 smart contracts from 129 real-world bridge applications, covering over 87% of mainstream bridges listed on aggregation sites like Chainspot.

The authors have released these datasets to the community to facilitate future research.

Key Insights and Ideas

  • The "Semantic Gap" is the Root Cause: The most interesting finding is that many bridge bugs aren't "coding errors" in the traditional sense, but rather a failure to maintain consistent logic across two different execution environments.
  • Static Analysis vs. Anomaly Detection: Prior tools like Xscope could only detect CCVs after an exploit occurred by looking for transaction anomalies. SmartAxe proves that static analysis can find these bugs before deployment, even without source code (by analyzing bytecode).
  • Normalization is Necessary: Because bridge developers don't follow a single standard (like OpenZeppelin for ERC-20), security tools must be "semantic-aware" rather than just looking for specific function names or signatures.

Key Results

  • High Accuracy: On the ground-truth dataset, SmartAxe achieved a precision of 84.95% and a recall of 89.77%.
  • Outperforming SOTA: SmartAxe significantly outperformed state-of-the-art tools like Ethainter and AChecker, which showed recall rates as low as 3-6% because they couldn't handle the unique logic of cross-chain bridges.
  • Real-World Impact: In the large-scale study, SmartAxe identified 232 new vulnerabilities across 126 contracts. These vulnerabilities affected assets totaling $1,885,250 USD.

Limitations and Future Work

  • EVM Focus: Currently, SmartAxe's core analyzer is designed for the Ethereum Virtual Machine (EVM). While most bridges use EVM, extending this to non-EVM chains (like Solana or Cosmos) is a necessary next step.
  • On-Chain State Dependency: The tool is purely static. It cannot account for access control logic that relies on real-time on-chain queries (e.g., checking if a specific address is currently on a dynamic blacklist).
  • Probabilistic Uncertainty: While the probabilistic model helps find associations, it can introduce false positives if the inferred relationship between a resource and a check is incorrect.

The authors suggest that future iterations could integrate more advanced type-recovery and semantic-recovery engines to further reduce false positives.

Summary updated

Abstract

With the increasing popularity of blockchain, different blockchain platforms coexist in the ecosystem (e.g., Ethereum, BNB, EOSIO, etc.), which prompts the high demand for cross-chain communication. Cross-chain bridge is a specific type of decentralized application for asset exchange across different blockchain platforms. Securing the smart contracts of cross-chain bridges is in urgent need, as there are a number of recent security incidents with heavy financial losses caused by vulnerabilities in bridge smart contracts, as we call them Cross-Chain Vulnerabilities (CCVs). However, automatically identifying CCVs in smart contracts poses several unique challenges. Particularly, it is non-trivial to (1) identify application-specific access control constraints needed for cross-bridge asset exchange, and (2) identify inconsistent cross-chain semantics between the two sides of the bridge. In this paper, we propose SmartAxe, a new framework to identify vulnerabilities in cross-chain bridge smart contracts. Particularly, to locate vulnerable functions that have access control incompleteness, SmartAxe models the heterogeneous implementations of access control and finds necessary security checks in smart contracts through probabilistic pattern inference. Besides, SmartAxe constructs cross-chain control-flow graph (xCFG) and data-flow graph (xDFG), which help to find semantic inconsistency during cross-chain data communication. To evaluate SmartAxe, we collect and label a dataset of 88 CCVs from real-attacks cross-chain bridge contracts. Evaluation results show that SmartAxe achieves a precision of 84.95% and a recall of 89.77%. In addition, SmartAxe successfully identifies 232 new/unknown CCVs from 129 real-world cross-chain bridge applications (i.e., from 1,703 smart contracts). These identified CCVs affect a total amount of digital assets worth 1,885,250 USD.
BibTeX
@article{liao2024smartaxe,
  author = {Zeqin Liao and Yuhong Nan and Henglong Liang and Sicheng Hao and Juan Zhai and Jiajing Wu and Zibin Zheng},
  title = {{SmartAxe: Detecting Cross-Chain Vulnerabilities in Bridge Smart Contracts via Fine-Grained Static Analysis}},
  journal = {Proc. ACM Softw. Eng.},
  year = {2024},
  doi = {10.1145/3643738},
}

Loading related content...

Figure