paperbot · PL 论文追踪

全部论文 待读 收藏

P2 VarLifter: Recovering Variables and Types from Bytecode of Solidity Smart Contracts

VarLifter:从 Solidity 智能合约字节码中恢复变量与类型
OOPSLA 8(OOPSLA2)2024匹配度 2/10 · 论文属于程序分析与抽象解释,但聚焦 Solidity 字节码的变量与类型恢复,既不涉及 LLM/Agent 与静态分析的交叉,也不涉及 ML 系统、浮点程序分析或贝叶斯程序分析,因此与用户当前研究方向交集很弱。引用 6 inbox
Yichuan Li, Wei Song, Jeff Huang
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:提出 VarLifter,从 Solidity 字节码精确恢复带类型的变量,提升反编译、审计与 fuzzing 效果。

许多 Solidity 智能合约仅公开字节码而无源码,且字节码丢失了变量与类型信息,仅保留栈操作和无类型内存/存储访问,导致现有反编译器常漏识别变量并错误推断类型。VarLifter 将数据区域每次读写字段视为潜在变量,剔除误报后,根据变量操作序列逐步精化其类型。作者在 34,832 个真实合约上评估,带类型变量恢复精确率达 97.48%、召回率达 91.84%,77% 的合约约 10 秒完成分析;替换两个先进反编译器的变量恢复模块后,分别多正确恢复 52.4% 和 74.6% 的带类型变量。应用于反编译、合约审计和字节码 fuzzing 表明恢复的变量信息能改进多项任务。

问题
大量智能合约只有字节码而无公开源码,字节码又丢失变量和类型信息,使审计与反编译难以准确识别变量及其类型。
方法
VarLifter 将数据区域中的每次读写字段视为潜在变量,先剔除误报,再依据变量在操作序列中的行为逐步精化类型。
评估
在 34,832 个真实 Solidity 合约上评估,带类型变量恢复精确率 97.48%、召回率 91.84%,77% 的合约约 10 秒完成;替换两个先进反编译器的变量恢复模块后显著提升恢复量。
原文摘要(Abstract)

Since funds or tokens in smart contracts are maintained through specific state variables, contract audit, an effective means for security assurance, particularly focuses on these variables and their related operations. However, the absence of publicly accessible source code for numerous contracts, with only bytecode exposed, hinders audit efforts. Recovering variables and their types from Solidity bytecode is thus a critical task in smart contract analysis and audit, yet this is a challenging task because the bytecode loses variable and type information, only with low-level data operated by stack manipulations and untyped memory/storage accesses. The state-of-the-art smart contract decompilers miss identifying many variables and incorrectly infer the types for many identified variables. To this end, we propose VarLifter , a lifter dedicated to the precise and efficient recovery of typed variables. VarLifter interprets every read or written field of a data region as at least one potential variable, and after discarding falsely identified variables, it progressively refines the variable types based on the variable behaviors in the form of operation sequences. We evaluate VarLifter on 34,832 real-world Solidity smart contracts. VarLifter attains a precision of 97.48% and a recall of 91.84% for typed variable recovery. Moreover, VarLifter finishes analyzing 77% of smart contracts in around 10 seconds per contract. If VarLifter is used to replace the variable recovery modules of the two state-of-the-art Solidity bytecode decompilers, 52.4%, and 74.6% more typed variables will be correctly recovered, respectively. The applications of VarLifter to contract decompilation, contract audit, and contract bytecode fuzzing illustrate that the recovered variable information improves many contract analysis tasks.

链接与引用

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

BibTeX
@article{00050024,
  title = {VarLifter: Recovering Variables and Types from Bytecode of Solidity Smart Contracts},
  author = {Yichuan Li and Wei Song and Jeff Huang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689711}
}