Smart contracts power decentralized financial (DeFi) services but are vulnerable to security exploits that can lead to significant financial losses. Existing security measures often fail to adequately protect these contracts due to the composability of DeFi protocols and the increasing sophistication of attacks. Through a large-scale empirical study of historical transactions from the 37 hacked DeFi protocols, we discovered that while benign transactions typically exhibit a limited number of unique control flows, in stark contrast, attack transactions consistently introduce novel, previously unobserved control flows. Building on these insights, we developed CrossGuard, a novel framework that enforces control flow integrity onchain to secure smart contracts. Crucially, CrossGuard does not require prior knowledge of specific hacks. Instead, configured only once at deployment, it enforces control flow whitelisting policies and applies simplification heuristics at runtime. This approach monitors and prevents potential attacks by reverting all transactions that do not adhere to the established control flow whitelisting rules. Our evaluation demonstrates that CrossGuard effectively blocks 35 of the 37 analyzed attacks when configured only once at contract deployment, maintaining a low false positive rate of 0.26% and minimal additional gas costs. These results underscore the efficacy of applying control flow integrity to smart contracts, significantly enhancing security beyond traditional methods and addressing the evolving threat landscape in the DeFi ecosystem.


翻译:智能合约为去中心化金融(DeFi)服务提供支持,但其安全漏洞可能导致重大财务损失。由于DeFi协议的可组合性及攻击手段日益复杂,现有安全措施往往无法充分保护这些合约。通过对37个遭黑客攻击的DeFi协议历史交易进行大规模实证研究,我们发现:良性交易通常仅展现有限数量的独特控制流,而攻击交易则持续引入前所未有的新型控制流。基于这些发现,我们开发了CrossGuard——一种在链上强制执行控制流完整性的新型智能合约安全框架。关键的是,CrossGuard无需预先了解具体攻击模式。该框架仅在部署时配置一次,即可在运行时实施控制流白名单策略并应用简化启发式规则。该方法通过回滚所有违反既定控制流白名单规则的交易,实现潜在攻击的监测与阻断。评估结果表明:在合约部署时仅配置一次的情况下,CrossGuard能有效阻断37个被分析攻击中的35个,同时保持0.26%的低误报率及可忽略的额外燃气成本。这些结果证实了控制流完整性机制应用于智能合约的有效性,其安全性显著超越传统方法,能够应对DeFi生态系统中不断演变的威胁态势。

0
下载
关闭预览

相关内容

智能体任务执行安全要求
专知会员服务
19+阅读 · 2025年7月12日
《人工智能安全标准体系(V1.0)》(征求意见稿)
专知会员服务
29+阅读 · 2025年3月23日
《结合机器人行为以实现安全、智能的执行》
专知会员服务
16+阅读 · 2023年7月4日
智慧安全产业发展白皮书
专知会员服务
71+阅读 · 2022年8月26日
专知会员服务
34+阅读 · 2021年5月8日
央行发布《人工智能算法金融应用评价规范》,28页pdf
专知会员服务
76+阅读 · 2021年5月2日
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
金融风控背后的技术综述
七月在线实验室
45+阅读 · 2019年2月28日
区块链隐私保护研究综述——祝烈煌详解
计算机研究与发展
23+阅读 · 2018年11月28日
【智能制造】德勤:预测性维护和智能工厂
产业智能官
11+阅读 · 2018年11月27日
【智能制造】智能制造的核心——智能决策
产业智能官
12+阅读 · 2018年4月11日
智能时代如何构建金融反欺诈体系?
数据猿
12+阅读 · 2018年3月26日
基于强化学习的量化交易框架
机器学习研究会
30+阅读 · 2018年2月22日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
智能体任务执行安全要求
专知会员服务
19+阅读 · 2025年7月12日
《人工智能安全标准体系(V1.0)》(征求意见稿)
专知会员服务
29+阅读 · 2025年3月23日
《结合机器人行为以实现安全、智能的执行》
专知会员服务
16+阅读 · 2023年7月4日
智慧安全产业发展白皮书
专知会员服务
71+阅读 · 2022年8月26日
专知会员服务
34+阅读 · 2021年5月8日
央行发布《人工智能算法金融应用评价规范》,28页pdf
专知会员服务
76+阅读 · 2021年5月2日
相关资讯
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
智能合约的形式化验证方法研究综述
专知
16+阅读 · 2021年5月8日
金融风控背后的技术综述
七月在线实验室
45+阅读 · 2019年2月28日
区块链隐私保护研究综述——祝烈煌详解
计算机研究与发展
23+阅读 · 2018年11月28日
【智能制造】德勤:预测性维护和智能工厂
产业智能官
11+阅读 · 2018年11月27日
【智能制造】智能制造的核心——智能决策
产业智能官
12+阅读 · 2018年4月11日
智能时代如何构建金融反欺诈体系?
数据猿
12+阅读 · 2018年3月26日
基于强化学习的量化交易框架
机器学习研究会
30+阅读 · 2018年2月22日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
5+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员