arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2408.04939cs.CRcs.SE
收藏

揭秘并检测以太坊智能合约中的密码学缺陷

Demystifying and Detecting Cryptographic Defects in Ethereum Smart Contracts

Jiashuo Zhang, Yiming Shen, Jiachi Chen, Jianzhong Su, Yanlin Wang, Ting Chen, Jianbo Gao, Zhong Chen

AI总结:

该研究定义九类智能合约密码学缺陷,并提出结合交易重放与动态污点分析的模糊测试工具 CrySol,在大规模合约中实现高精确率与召回率并揭示缺陷普遍存在。

摘要:

以太坊官方提供了一组系统级密码学 API,以增强智能合约的密码学能力。这些 API 已被用于超过 10% 的以太坊交易中,促使开发者实现各类链上密码学任务,例如数字签名。然而,由于开发者未必都是密码学专家,其临时性且可能存在缺陷的实现可能削弱密码学的理论保证,进而导致现实世界中的安全问题。为缓解这一威胁,我们开展了首个旨在揭秘并检测智能合约中密码学缺陷的研究。通过分析 2,406 份现实世界安全报告,我们定义了智能合约中的九类密码学缺陷,并给出详细描述和实用检测模式。基于该分类,我们提出了 CrySol,这是一种基于模糊测试的工具,用于自动检测智能合约中的密码学缺陷。它结合交易重放和动态污点分析来提取细粒度的密码学相关语义,并采用面向密码学的策略引导测试用例生成过程。此外,我们收集了一个包含 25,745 个现实世界中与密码学相关的智能合约的大规模数据集,并在其上评估了 CrySol 的有效性。结果表明,CrySol 实现了 95.4% 的总体精确率和 91.2% 的召回率。值得注意的是,CrySol 揭示出 25,745 个智能合约中有 5,847 个(22.7%)至少包含一个密码学缺陷,凸显了这些缺陷的普遍性。

英文摘要:

Ethereum has officially provided a set of system-level cryptographic APIs to enhance smart contracts with cryptographic capabilities. These APIs have been utilized in over 10% of Ethereum transactions, motivating developers to implement various on-chain cryptographic tasks, such as digital signatures. However, since developers may not always be cryptographic experts, their ad-hoc and potentially defective implementations could compromise the theoretical guarantees of cryptography, leading to real-world security issues. To mitigate this threat, we conducted the first study aimed at demystifying and detecting cryptographic defects in smart contracts. Through the analysis of 2,406 real-world security reports, we defined nine types of cryptographic defects in smart contracts with detailed descriptions and practical detection patterns. Based on this categorization, we proposed CrySol, a fuzzing-based tool to automate the detection of cryptographic defects in smart contracts. It combines transaction replaying and dynamic taint analysis to extract fine-grained crypto-related semantics and employs crypto-specific strategies to guide the test case generation process. Furthermore, we collected a large-scale dataset containing 25,745 real-world crypto-related smart contracts and evaluated CrySol's effectiveness on it. The result demonstrated that CrySol achieves an overall precision of 95.4% and a recall of 91.2%. Notably, CrySol revealed that 5,847 (22.7%) out of 25,745 smart contracts contain at least one cryptographic defect, highlighting the prevalence of these defects.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑