一句话:提出用静态数据流分析与符号分析推断并检测智能合约访问控制漏洞的方法,无需预定义模式或交易历史,精度与召回均优于现有工具。
智能合约多具金融属性、管理高价值资产,开发者依靠访问控制防止资产被恶意或未授权方滥用。但 Solidity 等语言并未内建基于权限的安全模型,访问控制检查常由开发者凭经验临时实现,既引入访问控制漏洞,也令“合约是否满足权限需求、是否无漏洞”难以推理。本文提出 AChecker:不同于依赖预定义模式或交易历史的前作,它用静态数据流分析推断合约中实现的访问控制,并进一步做符号分析,区分“未授权者取得控制权”是预期功能还是缺陷。作者在三个真实合约数据集(其一含被分配访问控制 CVE 的合约)上与八个工具对比,AChecker 的精度与召回均更优,并在以太坊 21 个常用合约上以 90% 精度标记漏洞。
As most smart contracts have a financial nature and handle valuable assets, smart contract developers use access control to protect assets managed by smart contracts from being misused by malicious or unauthorized people. Unfortunately, programming languages used for writing smart contracts, such as Solidity, were not designed with a permission-based security model in mind. Therefore, smart contract developers implement access control checks based on their judgment and in an adhoc manner, which results in several vulnerabilities in smart contracts, called access control vulnerabilities. Further, the in-consistency in implementing access control makes it difficult to reason about whether a contract meets access control needs and is free of access control vulnerabilities. In this work, we propose AChecker - an approach for detecting access control vulnerabilities. Unlike prior work, AChecker does not rely on pre-defined patterns or contract transactions history. Instead, it infers access control implemented in smart contracts via static data-flow analysis. Moreover, the approach performs further symbolic-based analysis to distinguish cases when unauthorized people can obtain control of the contract as intended functionality. We evaluated AChecker on three public datasets of real-world smart contracts, including one which consists of contracts with assigned access control CVEs, and compared its effectiveness with eight analysis tools. The evaluation results showed that AChecker outperforms these tools in terms of both precision and recall. In addition, AChecker flagged vulnerabilities in 21 frequently-used contracts on Ethereum blockchain with 90% precision.