Publications
Research on blockchain security, program analysis, and AI for vulnerability detection.
2026
- When and How Context Rot Appears in Coding Agents: A White-Box Study of Agent Skills in Code AuditingarXiv ’26arXiv preprint arXiv:2607.17937, 2026
- Chiral Analysis of Smart Contracts: Detecting Vulnerabilities from Relational Inconsistencies Across Business PathsarXiv ’26arXiv preprint arXiv:2607.17987, 2026
- Knowdit: Agentic Smart Contract Vulnerability Detection with Auditing Knowledge SummarizationarXiv ’26arXiv preprint arXiv:2603.26270, 2026
- EvoPoC: Automated Exploit Synthesis for DeFi Smart Contracts via Hierarchical Knowledge GraphsarXiv ’26arXiv preprint arXiv:2605.02868, 2026
2025
- Combining Fine-tuning and LLM-based Agents for Intuitive Smart Contract Auditing with JustificationsICSE ’252025 IEEE/ACM 47th International Conference on Software Engineering (ICSE) , May 2025
Abstract
Smart contracts are decentralized applications built atop blockchains like Ethereum. Recent research has shown that large language models (LLMs) have potential in auditing smart contracts, but the state-of-the-art indicates that even GPT-4 can achieve only 30% precision (when both decision and justification are correct). This is likely because off-the-shelf LLMs were primarily pre-trained on a general text/code corpus and not fine-tuned on the specific domain of Solidity smart contract auditing. In this paper, we propose iAudit, a general framework that combines fine-tuning and LLM-based agents for intuitive smart contract auditing with justifications. Specifically, iAudit is inspired by the observation that expert human auditors first perceive what could be wrong and then perform a detailed analysis of the code to identify the cause. As such, iAudit employs a two-stage fine-tuning approach: it first tunes a Detector model to make decisions and then tunes a Reasoner model to generate causes of vulnerabilities. However, fine-tuning alone faces challenges in accurately identifying the optimal cause of a vulnerability. Therefore, we introduce two LLM-based agents, the Ranker and Critic, to iteratively select and debate the most suitable cause of vulnerability based on the output of the fine-tuned Reasoner model. To evaluate iAudit, we collected a balanced dataset with 1,734 positive and 1,810 negative samples to fine-tune iAudit. We then compared it with traditional fine-tuned models (CodeBERT, GraphCodeBERT, CodeT5, and UnixCoder) as well as prompt learning-based LLMs (GPT4, GPT-3.5, and CodeLlama-13b/34b). On a dataset of 263 real smart contract vulnerabilities, iAudit achieves an F1 score of 91.21% and an accuracy of 91.11%. The causes generated by iAudit achieved a consistency of about 38% compared to the ground truth causes.
- PropertyGPT: LLM-driven Formal Verification of Smart Contracts through Retrieval-Augmented Property GenerationNDSS ’25 · NDSS Distinguished Paper Award32nd Annual Network and Distributed System Security Symposium, 2025Accepted by NDSS Symposium 2025
Abstract
With recent advances in large language models (LLMs), this paper explores the potential of leveraging state-of-the-art LLMs,such as GPT-4, to transfer existing human-written properties (e.g.,those from Certora auditing reports) and automatically generate customized properties for unknown code. To this end, we embed existing properties into a vector database and retrieve a reference property for LLM-based in-context learning to generate a new property for a given code. While this basic process is relatively straightforward, ensuring that the generated properties are (i) compilable, (ii) appropriate, and (iii) verifiable presents challenges. To address (i), we use the compilation and static analysis feedback as an external oracle to guide LLMs in iteratively revising the generated properties. For (ii), we consider multiple dimensions of similarity to rank the properties and employ a weighted algorithm to identify the top-K properties as the final result. For (iii), we design a dedicated prover to formally verify the correctness of the generated properties. We have implemented these strategies into a novel LLM-based property generation tool called PropertyGPT. Our experiments show that PropertyGPT can generate comprehensive and high-quality properties, achieving an 80% recall compared to the ground truth. It successfully detected 26 CVEs/attack incidents out of 37 tested and also uncovered 12 zero-day vulnerabilities, leading to $8,256 in bug bounty rewards.
- Beyond Stars and Commits: A Fair and Manipulation-Resistant Framework for Measuring Developer ContributionsFSE Companion ’25In Proceedings of the 33rd ACM International Conference on the Foundations of Software Engineering, 2025
2024
- GPTScan: Detecting Logic Vulnerabilities in Smart Contracts by Combining GPT with Program AnalysisICSE ’24Proceedings of the IEEE/ACM 46th International Conference on Software Engineering, Lisbon, Portugal, 2024
Abstract
Smart contracts are prone to various vulnerabilities, leading to substantial financial losses over time. Current analysis tools mainly target vulnerabilities with fixed control- or data-flow patterns, such as re-entrancy and integer overflow. However, a recent study on Web3 security bugs revealed that about 80% of these bugs cannot be audited by existing tools due to the lack of domain-specific property description and checking. Given recent advances in Large Language Models (LLMs), it is worth exploring how Generative Pre-training Transformer (GPT) could aid in detecting logic vulnerabilities.In this paper, we propose GPTScan, the first tool combining GPT with static analysis for smart contract logic vulnerability detection. Instead of relying solely on GPT to identify vulnerabilities, which can lead to high false positives and is limited by GPT’s pre-trained knowledge, we utilize GPT as a versatile code understanding tool. By breaking down each logic vulnerability type into scenarios and properties, GPTScan matches candidate vulnerabilities with GPT. To enhance accuracy, GPTScan further instructs GPT to intelligently recognize key variables and statements, which are then validated by static confirmation. Evaluation on diverse datasets with around 400 contract projects and 3K Solidity files shows that GPTScan achieves high precision (over 90%) for token contracts and acceptable precision (57.14%) for large projects like Web3Bugs. It effectively detects ground-truth logic vulnerabilities with a recall of over 70%, including 9 new vulnerabilities missed by human auditors. GPTScan is fast and cost-effective, taking an average of 14.39 seconds and 0.01 USD to scan per thousand lines of Solidity code. Moreover, static confirmation helps GPTScan reduce two-thirds of false positives.
- LLM4Vuln: A Unified Evaluation Framework for Decoupling and Enhancing LLMs’ Vulnerability ReasoningarXiv ’242024
- Static Application Security Testing (SAST) Tools for Smart Contracts: How Far Are We?FSE ’24 · ACM SIGSOFT Distinguished Paper AwardProc. ACM Softw. Eng., Jul 2024
- A Review on the Security of the Ethereum-Based DeFi EcosystemCMES ’24Computer Modeling in Engineering & Sciences, 2024
Abstract
Decentralized finance (DeFi) is a general term for a series of financial products and services. It is based on blockchain technology and has attracted people’s attention because of its open, transparent, and intermediary free. Among them, the DeFi ecosystem based on Ethereum-based blockchains attracts the most attention. However, the current decentralized financial system built on the Ethereum architecture has been exposed to many smart contract vulnerabilities during the last few years. Herein, we believe it is time to improve the understanding of the prevailing Ethereum-based DeFi ecosystem security issues. To that end, we investigate the Ethereum-based DeFi security issues: 1) inherited from the real-world financial system, which can be solved by macro-control; 2) induced by the problems of blockchain architecture, which require a better blockchain platform; 3) caused by DeFi invented applications, which should be focused on during the project development. Based on that, we further discuss the current solutions and potential directions of DeFi security. According to our research, we could provide a comprehensive vision to the research community for the improvement of Ethereum-based DeFi ecosystem security.
- DeFort: Automatic Detection and Analysis of Price Manipulation Attacks in DeFi ApplicationsISSTA ’24Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis, Vienna, Austria, 2024
Abstract
Although Decentralized Finance (DeFi) applications facilitate tamper-proof transactions among multiple anonymous users, since attackers can access the smart contract bytecode directly, vulnerabilities in the transaction mechanism, contract code, or third-party components can be easily exploited to manipulate token prices, leading to financial losses. Since price manipulation often relies on specific states and complex trading sequences, existing detection tools have limitations in addressing this problem. In addition, to swiftly identify the root cause of an attack and implement targeted defense and remediation measures, auditors typically prioritize understanding the methodology behind the attack, emphasizing ’how’ it occurred rather than simply confirming its existence. To address these problems, this paper presents a novel automatic price manipulation detection and analysis framework, named DeFort, which contains a price manipulation behavior model to guide on-chain detection, multiple price monitoring strategies to detect pools with abnormal token prices, and various profit calculation mechanisms to confirm attacks. Based on behavioral models, DeFort can automatically locate transactions and functions that cause abnormal price fluctuations and identify attackers and victims. Experimental results demonstrate that DeFort can outperform state-of-the-art price manipulation detection methods. Furthermore, after monitoring 441 real-world projects for two months, DeFort successfully detected five price manipulation attacks.
2023
- Detecting Smart Contract Project Anomalies in MetaverseMetaCom ’232023 IEEE International Conference on Metaverse Computing, Networking and Applications (MetaCom), 2023
- Smart Contract Firewall: Protecting the on-Chain Smart Contract ProjectsGLOBECOM ’23GLOBECOM 2023 - 2023 IEEE Global Communications Conference, 2023
2022
- Preventing Price Manipulation Attack by Front-RunningAAIS ’22Advances in Artificial Intelligence and Security, 2022
Abstract
Decentralized finance (DeFi), as one of the fastest growing directions in the field of decentralized applications based on blockchain and smart contract in the past two years, has attracted many participants and institutional investments, and represents a series of decentralized financial projects in the blockchain ecosystem behind it. The most noteworthy one is the Flash-loan based Price Manipulation Attack, which uses a series of new features of DeFi such as flash loan and liquidity pool, and the attack is complex and diverse, leading to the inability of traditional smart contract vulnerability mining means to effectively. In this work, we focus on detecting flash loan-based price manipulation attacks on DeFi applications, which exploit the DeFi project’s simple inquiry mechanism to gain large profits by manipulating users’ crypto asset prices. To this end, we propose a detector embedded in the blockchain client to detect whether the user’s crypto asset price is manipulated by monitoring the transaction execution process in real time, and innovatively propose the use of a front-running attack for remediation based on the amount of profit made by the attacker, solving the problem that the relevant attack can only be detected but not defended against, and reducing the possible financial loss to the DeFi project.