When Crypto Fails: Demystifying Cryptographic Defects in Ethereum Smart Contracts

IF 6.5 1区 计算机科学 Q1 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Jiashuo Zhang;Jiachi Chen;Yiming Shen;Tao Zhang;Yanlin Wang;Ting Chen;Jianbo Gao;Zhong Chen
{"title":"When Crypto Fails: Demystifying Cryptographic Defects in Ethereum Smart Contracts","authors":"Jiashuo Zhang;Jiachi Chen;Yiming Shen;Tao Zhang;Yanlin Wang;Ting Chen;Jianbo Gao;Zhong Chen","doi":"10.1109/TSE.2025.3551776","DOIUrl":null,"url":null,"abstract":"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 13.8% 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 a comprehensive study aimed at demystifying and detecting cryptographic defects in smart contracts. Through the analysis of 3,762 real-world security reports, we defined 12 types of cryptographic defects in smart contracts with detailed descriptions and practical detection patterns. Based on this categorization, we proposed <sc>CryptoScan</small>, the first static analyzer to automate the pre-deployment detection of cryptographic defects in smart contracts. <sc>CryptoScan</small> utilizes cross-contract and inter-procedure static analysis to identify crypto-related execution paths and employs taint analysis to extract fine-grained crypto-specific semantics for defect detection. Furthermore, we collected a large-scale dataset containing 79,598 real-world crypto-related smart contracts and evaluated <sc>CryptoScan</small>'s effectiveness on it. The results demonstrated that <sc>CryptoScan</small> achieves an overall precision of 96.1% and a recall of 93.3%. Notably, <sc>CryptoScan</small> revealed that 19,707 (24.8%) out of 79,598 smart contracts contain at least one cryptographic defect. Although not all defects directly cause financial losses, they indicate prevalent non-standard cryptographic implementations that should be addressed in real-world practices.","PeriodicalId":13324,"journal":{"name":"IEEE Transactions on Software Engineering","volume":"51 5","pages":"1381-1398"},"PeriodicalIF":6.5000,"publicationDate":"2025-03-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Software Engineering","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/10929622/","RegionNum":1,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

Abstract

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 13.8% 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 a comprehensive study aimed at demystifying and detecting cryptographic defects in smart contracts. Through the analysis of 3,762 real-world security reports, we defined 12 types of cryptographic defects in smart contracts with detailed descriptions and practical detection patterns. Based on this categorization, we proposed CryptoScan, the first static analyzer to automate the pre-deployment detection of cryptographic defects in smart contracts. CryptoScan utilizes cross-contract and inter-procedure static analysis to identify crypto-related execution paths and employs taint analysis to extract fine-grained crypto-specific semantics for defect detection. Furthermore, we collected a large-scale dataset containing 79,598 real-world crypto-related smart contracts and evaluated CryptoScan's effectiveness on it. The results demonstrated that CryptoScan achieves an overall precision of 96.1% and a recall of 93.3%. Notably, CryptoScan revealed that 19,707 (24.8%) out of 79,598 smart contracts contain at least one cryptographic defect. Although not all defects directly cause financial losses, they indicate prevalent non-standard cryptographic implementations that should be addressed in real-world practices.
当加密失败:揭秘以太坊智能合约中的加密缺陷
以太坊正式提供了一套系统级加密api,以增强具有加密功能的智能合约。这些api已在超过13.8%的以太坊交易中使用,激励开发人员实现各种链上加密任务,例如数字签名。然而,由于开发人员可能并不总是加密专家,他们的临时和潜在缺陷的实现可能会损害加密的理论保证,从而导致现实世界的安全问题。为了减轻这种威胁,我们进行了一项全面的研究,旨在揭开和检测智能合约中的加密缺陷。通过对3762份真实世界安全报告的分析,我们定义了智能合约中的12种加密缺陷,并给出了详细的描述和实用的检测模式。基于这种分类,我们提出了CryptoScan,这是第一个自动部署前检测智能合约中的加密缺陷的静态分析器。CryptoScan利用跨契约和过程间静态分析来识别与加密相关的执行路径,并使用污染分析来提取细粒度的特定于加密的语义以进行缺陷检测。此外,我们收集了一个包含79,598个真实世界加密相关智能合约的大规模数据集,并评估了CryptoScan在其上的有效性。结果表明,CryptoScan的总体准确率为96.1%,召回率为93.3%。值得注意的是,CryptoScan透露,在79,598个智能合约中,有19,707个(24.8%)至少包含一个加密缺陷。虽然不是所有的缺陷都直接导致经济损失,但它们表明了在现实世界的实践中应该解决的普遍的非标准加密实现。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
IEEE Transactions on Software Engineering
IEEE Transactions on Software Engineering 工程技术-工程:电子与电气
CiteScore
9.70
自引率
10.80%
发文量
724
审稿时长
6 months
期刊介绍: IEEE Transactions on Software Engineering seeks contributions comprising well-defined theoretical results and empirical studies with potential impacts on software construction, analysis, or management. The scope of this Transactions extends from fundamental mechanisms to the development of principles and their application in specific environments. Specific topic areas include: a) Development and maintenance methods and models: Techniques and principles for specifying, designing, and implementing software systems, encompassing notations and process models. b) Assessment methods: Software tests, validation, reliability models, test and diagnosis procedures, software redundancy, design for error control, and measurements and evaluation of process and product aspects. c) Software project management: Productivity factors, cost models, schedule and organizational issues, and standards. d) Tools and environments: Specific tools, integrated tool environments, associated architectures, databases, and parallel and distributed processing issues. e) System issues: Hardware-software trade-offs. f) State-of-the-art surveys: Syntheses and comprehensive reviews of the historical development within specific areas of interest.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信