DeFiScreener: Efficient DeFi Attack Pre-screening in Smart Contracts via Historical Case Matching

· Source: cs.SE updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Cybersecurity & Data Privacy, Blockchain & Distributed Ledger Technology · Depth: Expert, extended

Summary

DeFiScreener is an automated pre-screening framework for DeFi smart contract attacks, designed to address the limited coverage of existing security tools by leveraging historical exploit cases. It processes target project source code, building Function Call Trees (FCTs) and generating semantic embeddings for each function using a large language model (LLM). A dual-level screening process matches function embeddings against an Attack Pattern Library and employs Attack Pattern Oriented Monte Carlo Tree Search (APO-MCTS) to efficiently explore FCTs for vulnerable call sequences. Evaluated on a dataset of 207 real-world DeFi attack incidents, totaling approximately \$2.97 billion in aggregate losses, DeFiScreener achieved a remarkable 98.55% recall and 84.30% precision. It also effectively recovered 14 of 17 real-world DeFi attacks in zero-day scenarios and screened 88 DeFi attacks overlooked by state-of-the-art tools.

Key takeaway

For smart contract auditors and security engineers evaluating new DeFi protocols, DeFiScreener offers a critical proactive defense mechanism. You should integrate this historical case-matching pre-screening into your audit workflow to efficiently identify known and structurally analogous vulnerabilities, especially given the "perilous temporal asymmetry" of exploit reuse. This approach significantly expands coverage beyond specialized detectors, reducing the risk of overlooked attacks and fortifying the rapidly evolving DeFi ecosystem.

Key insights

DeFiScreener proactively identifies smart contract vulnerabilities by matching new code against historical attack patterns using LLM embeddings.

Principles

Method

DeFiScreener models function semantics via LLMs, constructs Function Call Trees, then applies dual-level screening (function embedding matching, APO-MCTS for sequences), and finally interprets findings with an LLM.

In practice

Topics

Code references

Best for: CTO, VP of Engineering/Data, Director of AI/ML, AI Security Engineer, AI Scientist, Research Scientist

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.SE updates on arXiv.org.