Computer Integrated Manufacturing System ›› 2026, Vol. 32 ›› Issue (3): 1011-1024.DOI: 10.13196/j.cims.2025.BPM10

Previous Articles     Next Articles

ReChecker:Detecting reentrancy vulnerabilities in smart contracts based on model checking

CHAI Xinzhuo,LIU Guoxi,LI Lecheng,DAI Fei,HUANG Bi+   

  1. School of Big Data and Intelligent Engineering,Southwest Forestry University
  • Online:2026-03-31 Published:2026-04-03
  • Supported by:
    Project supported by the National Natural Science Foundation,China(No.62262063),the Yunnan Provincial Fundamental Research Program,China(No.202501AS070046),the Research and Development Program of Yunnan Province,China(No.202402AD080002-5),the Key Industry Science and Technology Projects for University Services in Yunnan Province,China(No.FWCY-ZNT2024020),the Dou Wanchun Expert Workstation of Yunnan Province,China(No.202105AF150013),the Yunnan Provincial Revitalization Talents Support Plan,China(No.XDYC-CYCX-2022-0009),the Science and Technology Youth Lift Talents of Yunnan Province,China,and the Open Fund Project of Key Laboratory of the Ministry of Education,China(No.EIN2024C004)).

ReChecker:基于模型检测的智能合约重入漏洞检测方法

柴新卓,刘国玺,李乐成,代飞,黄苾+   

  1. 西南林业大学大数据与智能工程学院
  • 作者简介:
    柴新卓(2000-),男,云南昆明人,硕士研究生,研究方向:区块链、智能合约、复杂系统建模,E-mail:takuzhuo@swfu.edu.cn;

    刘国玺(1996-),男,云南丽江人,硕士研究生,研究方向:深度学习、计算机视觉,E-mail:guoxiliu@swfu.edu.cn;

    李乐成(1996-),男,云南昆明人,博士研究生,研究方向:深度学习、交通预测,E-mail:lechengli@swfu.edu.cn;

    代飞(1982-),男,四川乐山人,教授,博士,研究方向:软件工程、服务计算、业务过程管理,E-mail:daifei@swfu.edu.cn;

    +黄苾(1982-),女,福建宁德人,讲师,硕士,研究方向:软件工程、业务过程、大数据挖掘与应用,通讯作者,E-mail:bihuang@swfu.edu.cn。
  • 基金资助:
    国家自然科学基金资助项目(62262063);云南省基础研究计划资助项目 (202501AS070046);云南省重点研发计划资助项目(202402AD080002-5);云南省高校服务重点产业科技项目(FWCY-ZNT2024020);云南省窦万春专家工作站资助项目(202105AF150013);云南省“兴滇英才支持计划”产业创新人才资助项目(XDYC-CYCX-2022-0009);云南省科协青年科技人才托举工程资助项目;教育部重点实验室开放基金资助项目(EIN2024C004)。

Abstract: Ensuring the security of smart contracts against reentrancy vulnerabilities is critical,particularly for contracts with locking mechanisms,which are often overlooked by existing techniques based on symbolic execution,fuzz testing and model checking.A model-checking-based approach for automatic reentrancy vulnerability detection in smart contracts named ReChecker was presented,categorizing contracts as either with or without locking mechanisms.By utilizing the Check-Effect-Interaction (CEI) pattern and lock mechanisms,ReChecker modeled smart contract source code as a Labelled Transition System (LTS) using an Abstract Syntax Tree (AST).It then formalized reentrancy safety properties through Linear Temporal Logic (LTL) formulas based on execution order and access control.Utilizing the Process Analysis Toolkit (PAT),ReChecker automated vulnerability detection for both locked and lock-free smart contracts.Experimental results on three datasets demonstrated that ReChecker outperformed five baseline methods,improving accuracy by 10.83% and reducing false negatives and false positives by 12% and 17.5%,respectively.

Key words: smart contracts, reentrancy vulnerability, model checking, abstract syntax tree, labeled transition system, linear temporal logic

摘要: 智能合约的重入漏洞检测是保障其安全性的重要技术手段之一。现有基于符号执行、模糊测试和模型检测方法,只考虑了无锁智能合约,未考虑有锁智能合约的重入漏洞检测。有效建模智能合约并定义重入漏洞的安全性质具有挑战性。本文提出了一种基于模型检测的智能合约重入漏洞检测方法(ReChecker),将智能合约细分为有锁智能合约和无锁智能合约,结合检查-生效-交互模式(CEI)和锁机制,实现对智能合约重入漏洞的自动检测。首先,基于抽象语法树(AST),将智能合约源代码建模为标号迁移系统(LTS);其次,从执行顺序和访问控制视角,使用线性时序逻辑(LTL)公式分别定义了基于CEI模式和基于锁机制的重入漏洞安全性质;然后,在进程分析工具(PAT)的支持下,自动化地检测了有锁智能合约和无锁智能合约是否会发生重入漏洞。最后,为了验证所提方法的有效性,在3个数据集上进行了实验,实验结果表明:相比5种基准方法,ReChecker的准确率平均提升了10.83%,漏报率和误报率平均降低了12%和17.5%。

关键词: 智能合约, 重入漏洞, 模型检测, 抽象语法树, 标号迁移系统, 线性时序逻辑

CLC Number: