paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Beyond “Protected” and “Private”: An Empirical Security Analysis of Custom Function Modifiers in Smart Contracts

超越“Protected”与“Private”:智能合约自定义函数修饰符的实证安全分析
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 2/10 · 该论文是面向以太坊智能合约自定义修饰符的安全静态分析/符号执行工具,属于程序分析范畴,但与用户核心方向(ML/Agentic 程序静态分析、LLM 与程序分析/形式化验证交叉、浮点程序分析、贝叶斯程序分析)没有直接关系。仅在“静态分析工具+工业落地”层面有很弱的共性。引用 37 inbox
Yuzhou Fang, Daoyuan Wu, Xiao Yi, Shuai Wang, Yufan Chen, Mengjie Chen, Yang Liu, Lingxiao Jiang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 SoMo 工具,通过修饰符依赖图与符号路径约束检测以太坊智能合约中可被绕过的自定义函数修饰符。

智能合约函数默认可被任意调用,Solidity 的 modifier 机制允许定义超越 protected/private 的自定义访问控制。本文对以太坊真实合约中的 modifier 开展大规模安全分析,设计实现 SoMo 工具,自动识别可从无保护函数绕过的非安全 modifier。针对 modifier 与变量/函数间复杂依赖及攻击入口歧义,提出 Modifier Dependency Graph 连接相关控制/数据流,在图上建模系统变量、生成符号路径约束并迭代测试候选入口函数。评估中,SoMo 覆盖 SPCon 全部真阳性并正确排除 11 个假阳性中的 9 个;在 62,464 个合约上精度 91.2%,发现 400 余个可绕过的合约,总结出三类安全发现与九种使用模式,并集成至 MetaScan。

问题
智能合约函数默认公开可调用,Solidity 的 modifier 使开发者能自定义访问控制,但真实合约中 modifier 可能被绕过,其安全性缺乏大规模实证理解。
方法
提出 SoMo,构建 Modifier Dependency Graph 连接 modifier 相关控制/数据流,建模系统变量、生成符号路径约束,并迭代测试候选攻击入口函数以识别可绕过的 modifier。
评估
在 62,464 个真实合约数据集上评估,精度 91.2%,发现 400 余个可绕过 modifier 的合约;与 SPCon 对比覆盖其全部真阳性并排除 11 个假阳性中的 9 个,同时总结安全发现与使用模式,工具已集成到 MetaScan。
原文摘要(Abstract)

A smart contract is a piece of application-layer code running on blockchain ledgers and it provides programmatic logic via transaction-based execution of pre-defined functions. Smart contract functions are by default invokable by any party. To safeguard them, the mainstream smart contract language, i.e., Solidity of the popular Ethereum blockchain, proposed a unique language-level keyword called “modifier,” which allows developers to define custom function access control policies beyond the traditional “protected” and “private” modifiers in classic programming languages. In this paper, we aim to conduct a large-scale security analysis of the modifiers used in real-world Ethereum smart contracts. To achieve this, we design and implement a novel smart contract analysis tool called SoMo. Its main objective is to identify insecure modifiers that can be bypassed from one or more unprotected smart contract functions. This is challenging because of the complicated relationship between modifiers and their variables/functions and the ambiguity of attacker-accessible entry functions. To overcome them, we first propose a new structure, the Modifier Dependency Graph (MDG), to connect all the modifier-related control/data flows. Over MDGs, we then model system variables, generate symbolic path constraints, and iteratively test each candidate entry function. Our extensive evaluation shows that SoMo outperforms the state-of-the-art SPCon tool by detecting all its true positives and correctly avoiding 9 out of 11 false positives. It also achieves high precision of 91.2% when analyzing a large dataset of 62,464 contracts, over 400 of which were identified with bypassable modifiers. Our analysis further reveals three interesting security findings about modifiers and nine major types of modifier usage in the wild. SoMo has been integrated into an online security scanning service, MetaScan.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{FangWYWCCLJ23,
  title = {Beyond “Protected” and “Private”: An Empirical Security Analysis of Custom Function Modifiers in Smart Contracts},
  author = {Yuzhou Fang and Daoyuan Wu and Xiao Yi and Shuai Wang and Yufan Chen and Mengjie Chen and Yang Liu and Lingxiao Jiang},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598125}
}