區塊鏈論文速讀A會-ISSTA 2023(2/2)如何檢測DeFi協議中的價格操縱漏洞

圖片

Conference:ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA)

CCF level:CCF A

Categories:Software Engineering/System Software/Programming Languages

Year:2023

第1~5篇區塊鏈文章 請點擊此處查看

6

Title:?

SmartState: Detecting State-Reverting Vulnerabilities in Smart Contracts via Fine-Grained State-Dependency Analysis

SmartState:通過細粒度狀態依賴性分析檢測智能合約中的狀態恢復漏洞

Authors:?

圖片

Key words:

bug finding, smart contract, static analysis, state dependency

bug查找、智能合約、靜態分析、狀態依賴

Abstract:?

Smart contracts written in Solidity are widely used in different blockchain platforms such as Ethereum, TRON and BNB Chain. One of the unique designs in Solidity smart contracts is its statereverting mechanism for error handling and access control. Unfortunately, a number of recent security incidents showed that adversaries also utilize this mechanism to manipulate critical states of smart contracts, and hence, bring security consequences such as illegal profit-gain and Deny-of-Service (DoS). In this paper, we call such vulnerabilities as the State-reverting Vulnerability (SRV). Automatically identifying SRVs poses unique challenges, as it requires an in-depth analysis and understanding of the state-dependency relations in smart contracts. This paper presents SmartState, a new framework for detecting state-reverting vulnerability in Solidity smart contracts via finegrained state-dependency analysis. SmartState integrates a set of novel mechanisms to ensure its effectiveness. Particularly, Smart- State extracts state dependencies from both contract bytecode and historical transactions. Both of them are critical for inferring dependencies related to SRVs. Further, SmartState models the generic patterns of SRVs (i.e., profit-gain and DoS) as SRV indicators, and hence effectively identify SRVs based on the constructed statedependency graph. To evaluate SmartState, we manually annotated a ground-truth dataset which contains 91 SRVs in the real world. Evaluation results showed that SmartState achieves a precision of 87.23% and a recall of 89.13%. In addition, SmartState successfully identifies 406 new SRVs from 47,351 real-world smart contracts. 11 of these SRVs are from popular smart contracts with high transaction amounts (i.e., top 2000). In total, our reported SRVs affect a total amount of digital assets worth 428,600 USD.

用?Solidity?編寫的智能合約廣泛應用于以太坊、波場和 BNB Chain?等不同的區塊鏈平臺。Solidity 智能合約的獨特設計之一是其用于錯誤處理和訪問控制的狀態恢復機制。不幸的是,最近的一些安全事件表明,攻擊者還利用這種機制來操縱智能合約的關鍵狀態,從而帶來非法獲利和拒絕服務?(DoS) 等安全后果。在本文中,我們將此類漏洞稱為狀態恢復漏洞 (SRV)。自動識別 SRV 帶來了獨特的挑戰,因為它需要深入分析和理解智能合約中的狀態依賴關系。本文介紹了 SmartState,這是一種通過細粒度狀態依賴分析檢測 Solidity 智能合約中狀態恢復漏洞的新框架。SmartState 集成了一套新穎的機制來確保其有效性。特別是,Smart-State?從合約字節碼和歷史交易中提取狀態依賴關系。它們兩者對于推斷與 SRV 相關的依賴關系都至關重要。此外,SmartState 將 SRV 的通用模式(即利潤收益和 DoS)建模為 SRV 指標,從而根據構建的狀態依賴圖有效地識別 SRV。為了評估 SmartState,我們手動標注了一個包含現實世界中 91 個 SRV 的真實數據集。評估結果表明,SmartState 的準確率為 87.23%,召回率為 89.13%。此外,SmartState 還從 47,351 個現實世界智能合約中成功識別出 406 個新的 SRV。其中 11 個 SRV 來自交易金額較高的熱門智能合約(即前 2000 個)。總的來說,我們報告的 SRV 影響了總價值 428,600 美元的數字資產。

圖片

圖片

圖片

圖片

圖片

assertion-related state dependency (ASD)

temporal order state dependency (TSD)

圖片

圖片

圖片

Pdf link:

https://dl.acm.org/doi/10.1145/3597926.3598111

7

Title:?

Toward Automated Detecting Unanticipated Price Feed in Smart Contract

在智能合約中自動檢測意外價格饋送

Authors:?

圖片

Key words:

Smart Contract, Formal Verification, Price Oracle, DeFi

智能合約、形式化驗證、價格預言機、DeFi

Abstract:?

Decentralized finance (DeFi) based on smart contracts has reached a total value locked (TVL) of over USD 200 billion in 2022. In DeFi ecosystems, price oracles play a critical role in providing real-time price feeds for cryptocurrencies to ensure accurate asset pricing in smart contracts. However, the price oracle also faces security issues, including the possibility of unanticipated price feeds, which can lead to imbalances in debt and assets in the DeFi protocol. However, existing solutions cannot effectively combine transactions and code for real-time monitoring of price oracles. To address this limitation, we first categorize price oracles as either DON oracles, DEX oracles, or internal oracles based on trusted parties, and analyze their security risks, data sources, price duration, and query fees. Then, we propose VeriOracle, a formal verification framework for the automated detection of unanticipated price feeds in smart contracts. VeriOracle can deploy a formal semantic model of the price oracle on the blockchain to detect the status of smart contracts and identify unanticipated price feed transactions in real time. We apply VeriOracle to verify over 500,000 transactions of 13 vulnerable DeFi protocols in the real world. The experimental results show that (1) VeriOracle is effective and it can detect unanticipated price feeds before DeFi attacks (33,714 blocks ahead of the attacker in the best case); (2) VeriOracle is efficient in that its verification time (about 4s) is less than the block time of Ethereum (about 14s), which means VeriOracle can detect unsafe transactions in real time; and (3) VeriOracle is extendable for verifying defense strategies. Attacks using unanticipated price feeds can only succeed in particular smart contract states. VeriOracle can verify which smart contract states can defend against attacks.

基于智能合約的去中心化金融?(DeFi) 已在 2022 年達到超過 2000 億美元的總鎖定價值?(TVL)。在 DeFi 生態系統中,價格預言機在為加密貨幣提供實時價格信息以確保智能合約中資產定價準確方面發揮著關鍵作用。然而,價格預言機也面臨安全問題,包括可能出現意外的價格信息,這可能導致 DeFi 協議中的債務和資產不平衡。然而,現有的解決方案無法有效地結合交易和代碼來實時監控價格預言機。為了解決這一限制,我們首先根據可信方將價格預言機分類為?DON 預言機、DEX 預言機或內部預言機,并分析它們的安全風險、數據來源、價格持續時間和查詢費用。然后,我們提出了 VeriOracle,這是一個用于自動檢測智能合約中意外價格信息的形式化驗證框架。VeriOracle 可以在區塊鏈上部署價格預言機的形式化語義模型,以檢測智能合約的狀態并實時識別意外的價格饋送交易。我們應用 VeriOracle 驗證了現實世界中 13 個易受攻擊的 DeFi 協議的 500,000 多筆交易。實驗結果表明:(1)VeriOracle 是有效的,它可以在 DeFi 攻擊之前檢測到意外的價格饋送(最好情況下比攻擊者提前 33,714 個區塊);(2)VeriOracle 的驗證時間(約 4 秒)小于以太坊的出塊時間(約 14 秒),這意味著 VeriOracle 可以實時檢測不安全的交易;(3)VeriOracle 可擴展以驗證防御策略。使用意外價格饋送的攻擊只能在特定的智能合約狀態下成功。VeriOracle 可以驗證哪些智能合約狀態可以抵御攻擊。

圖片

?decentralized exchanges (DEX)

Decentralized Oracle Networks (DONs)

圖片

圖片

圖片

圖片

圖片

圖片

圖片

Pdf link:

https://dl.acm.org/doi/10.1145/3597926.3598133

8

Title:?

Detecting State Inconsistency Bugs in DApps via On-Chain Transaction Replay and Fuzzing

通過鏈上交易重放和模糊測試檢測 DApp 中的狀態不一致錯誤

Authors:?

Mingxi Ye,Sun Yat-sen University,China

Yuhong Nan,Sun Yat-sen University

Zibin Zheng,Sun Yat-sen University

Dongpeng Wu, Sun Yat-sen University

Huizhong Li, WeBank,China

Abstract:?

Decentralized applications (DApps) consist of multiple smart contracts running on Blockchain. With the increasing popularity of the DApp ecosystem, vulnerabilities in DApps could bring significant impacts such as financial losses. Identifying vulnerabilities in DApps is by no means trivial, as modern DApps consist of complex interactions across multiple contracts. Previous research suffers from either high false positives or false negatives, due to the lack of precise contextual information which is mandatory for confirming smart contract vulnerabilities when analyzing smart contracts. In this paper, we present IcyChecker, a new fuzzing-based framework to effectively identify State inconsistency (SI) Bugs – a specific type of bugs that can cause vulnerabilities such as re-entrancy, front-running with complex patterns. Different from prior works, IcyChecker utilizes a set of accurate contextual information for contract fuzzing by replaying the on-chain historical transactions. Besides, instead of designing specific testing oracles which are required by other fuzzing approaches, IcyChecker implements novel mechanisms to mutate a set of fuzzing transaction sequences, and further identify SI bugs by observing their state differences. Evaluation of IcyChecker over the top 100 popular DApps showed it effectively identifies a total number of 277 SI bugs, with a precision of 87%. By comparing IcyChecker with other state-of-the-art tools (i.e., Smartian, Confuzzius, and Sailfish), we show IcyChecker not only identifies more SI bugs but also with much lower false positives, thanks to its integration of accurate on-chain data and unique fuzzing strategies. Our research sheds light on new ways of detecting smart contract vulnerabilities in DApps.


?

去中心化應用程序(DApps)由在區塊鏈上運行的多個智能合約組成。隨著 DApp 生態系統的日益普及,DApp 中的漏洞可能會帶來重大影響,例如財務損失。識別 DApp 中的漏洞絕非易事,因為現代 DApp 包含跨多個合約的復雜交互。先前的研究存在高誤報率或漏報率,這是因為缺乏精確的上下文信息,而這些信息在分析智能合約時對于確認智能合約漏洞是必不可少的。在本文中,我們提出了?IcyChecker,這是一個基于模糊測試的新框架,可有效識別狀態不一致(SI)錯誤 - 這是一種特定類型的錯誤,可能導致諸如重入、具有復雜模式的搶先交易等漏洞。與之前的研究不同,IcyChecker 通過重放鏈上歷史交易,利用一組準確的上下文信息進行合約模糊測試。此外,IcyChecker 無需設計其他模糊測試方法所需的特定測試預言機,而是實現了新穎的機制來改變一組模糊測試交易序列,并通過觀察它們的狀態差異進一步識別 SI 錯誤。對前 100 個流行 DApp?的 IcyChecker 評估表明,它有效識別了總共 277 個 SI 錯誤,準確率為 87%。通過將 IcyChecker 與其他最先進的工具(即 Smartian、Confuzzius 和 Sailfish)進行比較,我們發現 IcyChecker 不僅可以識別出更多的 SI 錯誤,而且由于其集成了準確的鏈上數據和獨特的模糊測試策略,誤報率也低得多。我們的研究為檢測 DApp 中的智能合約漏洞的新方法提供了啟示。

圖片

Pdf link:

https://dl.acm.org/doi/10.1145/3597926.3598057

9

Title:?

DeFiTainter: Detecting Price Manipulation Vulnerabilities in DeFi Protocols

DeFiTainter:檢測 DeFi 協議中的價格操縱漏洞

Authors:?

圖片

Key words:

vulnerability detection, smart contract, taint analysis

漏洞檢測、智能合約、污點分析

Abstract:?

DeFi protocols are programs that manage high-value digital assets on blockchain. The price manipulation vulnerability is one of the common vulnerabilities in DeFi protocols, which allows attackers to gain excessive profits by manipulating token prices. In this paper, we propose DeFiTainter, an inter-contract taint analysis framework for detecting price manipulation vulnerabilities. DeFiTainter features two innovative mechanisms to ensure its effectiveness. The first mechanism is to construct a call graph for inter-contract taint analysis by restoring call information, not only from code constants but also from contract storage and function parameters. The second mechanism is a high-level semantic induction tailored for detecting price manipulation vulnerabilities, which accurately identifies taint sources and sinks and tracks taint data across contracts. Extensive evaluation of real-world incidents and high-value DeFi protocols shows that DeFiTainter outperforms existing approaches and achieves state-of-the-art performance with a precision of 96% and a recall of 91.3% in detecting price manipulation vulnerabilities. Furthermore, DeFiTainter uncovers three previously undisclosed price manipulation vulnerabilities.

DeFi 協議是管理區塊鏈上高價值數字資產的程序。價格操縱漏洞是 DeFi 協議中常見的漏洞之一,攻擊者可以通過操縱代幣價格獲取超額利潤。本文提出了 DeFiTainter,一個用于檢測價格操縱漏洞的合約間污點分析框架。DeFiTainter 具有兩種創新機制來確保其有效性。第一種機制是通過恢復調用信息來構建合約間污點分析的調用圖,不僅從代碼常量,而且從合約存儲和函數參數中恢復調用信息。第二種機制是專門為檢測價格操縱漏洞而定制的高級語義歸納,它可以準確識別污點源和污點接收器并跟蹤跨合約的污點數據。對現實世界事件和高價值 DeFi 協議的廣泛評估表明,DeFiTainter 優于現有方法,在檢測價格操縱漏洞方面以 96% 的準確率和 91.3% 的召回率實現了最先進的性能。此外,DeFiTainter 還發現了三個以前未披露的價格操縱漏洞。

圖片

圖片

圖片

圖片

圖片

圖片

Pdf link:

https://dl.acm.org/doi/10.1145/3597926.3598124

圖片

關注我們,持續接收區塊鏈最新論文

洞察區塊鏈技術發展趨勢

Follow us to keep receiving the latest blockchain papers

Insight into Blockchain Technology Trends

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/diannao/42493.shtml
繁體地址,請注明出處:http://hk.pswp.cn/diannao/42493.shtml
英文地址,請注明出處:http://en.pswp.cn/diannao/42493.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

09視圖,觸發器,事務,存儲過程,函數,流程控制,索引,隔離機制,鎖機制,三大范式

【一】視圖 (1)視圖須知概念 1.什么是視圖? 視圖就是通過查詢得到一張虛擬表,然后保存下來,下次可以直接使用 2.為什么要用視圖? 如果要頻繁操作一張虛擬表(拼表組成),就可以制作成視圖,后續直接操作 注意…

IDEA 創建springboot項目雜記-更新中

一、工具使用雜記 1、使用maven 創建新springboot項目時,因為https://start.spring.io/ 連接不上項目無法創建。直接把腳手架地址換為國內的 http://start.aliyun.com

田忌賽馬 貪心

本題是更難的那道,一場50 最低為o 第一行一個整數 𝑛n ,表示他們各有幾匹馬(兩人擁有的馬的數目相同)。第二行 𝑛n 個整數,每個整數都代表田忌的某匹馬的速度值(0≤0≤ 速度值 ≤100≤1…

Python】從文本字符串中提取數字、電話號碼、日期、網址的方法

關于從文本字符串中提取數字、電話號碼、日期和網址的方法: 提取數字: 在 Python 中,使用正則表達式 \d 來匹配數字。 \d 表示匹配一個數字字符(0-9)。如果要匹配連續的數字,可以使用 \d 。 import re def …

C++面向對象的常見面試題目(一)

1. 面向對象的三大特征 &#xff08;1&#xff09;封裝&#xff1a;隱藏對象的內部狀態&#xff0c;只暴露必要的接口。 #include <iostream> #include <string>// 定義一個簡單的類 Person class Person { private: // 私有成員&#xff0c;外部不可直接訪問std…

Mac OS ssh 連接提示 Permission denied (publickey)

這錯誤有點奇葩&#xff0c;MacBook的IDE(vscode和pycharm)遠程都連不上&#xff0c;terminal能連上&#xff0c;windows的pycharm能連上&#xff0c;見鬼了&#xff0c;所以肯定不是秘鑰的問題了&#xff0c;查了好久竟然發現是權限的問題。。 chmod 400 ~/.ssh/id_rsa http…

華為機試HJ37統計每個月兔子的總數

華為機試HJ37統計每個月兔子的總數 題目&#xff1a; 想法&#xff1a; 上述題目實際是一個斐波那契數列&#xff0c;利用斐波那契數列對問題進行求解 input_number int(input())def fib(n):if n < 2:return 1else:n_1 1n_2 1count 2while count < n:n_1, n_2 n_…

【Android】【多屏】多屏異顯異觸調試技巧總結

這里寫目錄標題 如何獲取多屏IDs獲取多屏的size/density如何啟動應用到指定DisplayId多屏截屏/錄屏screencapscreenrecord發送按鍵到指定DisplayId 如何獲取多屏IDs dumpsys display | grep mDisplayIdtrinket:/ # dumpsys display | grep mDisplayIdmDisplayId0mDisplayId2 t…

【AI資訊】可以媲美GPT-SoVITS的低顯存開源文本轉語音模型Fish Speech

Fish Speech是一款由fishaudio開發的全新文本轉語音工具&#xff0c;支持中英日三種語言&#xff0c;語音處理接近人類水平&#xff0c;使用Flash-Attn算法處理大規模數據&#xff0c;提供高效、準確、穩定的TTS體驗。 Fish Audio

區塊鏈技術的應用場景和優勢。

區塊鏈技術具有廣泛的應用場景和優勢。 區塊鏈技術的應用場景&#xff1a; 1. 金融服務&#xff1a;區塊鏈可用于支付、跨境匯款、借貸和結算等金融服務&#xff0c;提高交易效率、降低成本并增強安全性。 2. 物聯網&#xff08;IoT&#xff09;&#xff1a;區塊鏈可以用于物…

機器學習Day12:特征選擇與稀疏學習

1.子集搜索與評價 相關特征&#xff1a;對當前學習任務有用的特征 無關特征&#xff1a;對當前學習任務沒用的特征 特征選擇&#xff1a;從給定的特征集合中選擇出相關特征子集的過程 為什么要特征選擇&#xff1f; 1.任務中經常碰到維數災難 2.去除不相關的特征能降低學習的…

Git注釋規范

主打一個有用 代碼的提交規范參考如下&#xff1a; init:初始化項目feat:新功能&#xff08;feature&#xff09;fix:修補bugdocs:文檔&#xff08;documentation&#xff09;style:格式&#xff08;不影響代碼運行的變動&#xff09;refactor:重構&#xff08;即不是新增功能…

NodeJs獲取文件擴展名

path.extname 是 Node.js 路徑模塊 (path) 中的一個方法&#xff0c;用于獲取文件路徑的擴展名。擴展名是指文件名中最后一個 .&#xff08;點&#xff09;之后的部分&#xff0c;包括這個 .。 const path require(path);const filename example.txt; const ext path.extna…

計算機網絡之令牌環

1.令牌環工作原理 令牌環&#xff08;Token Ring&#xff09;是一種局域網&#xff08;LAN&#xff09;的通信協議&#xff0c;最初由IBM在1984年開發并標準化為IEEE 802.5標準。在令牌環網絡中&#xff0c;所有的計算機或工作站被連接成一個邏輯或物理的環形拓撲結構。網絡中…

排序(2)

我們在排序&#xff08;1&#xff09;中說到選擇排序的代碼&#xff1a; void SelectSort(int* a,int n) {int begin0,endn-1;int minibegin,maxbegin;for(int ibegin1;i<end;i){if(a[i]>a[max]){maxii;}if(a[i]<a[mini]){minii;}begin;--end;}Swap(&a[beign],&a…

SKF軸承故障頻率查詢

1&#xff0c;第一步&#xff1a;搜索軸承型號 skf官網 2&#xff0c;第二步&#xff1a;查詢故障頻率。 第三步&#xff1a;

尚品匯-(十四)

&#xff08;1&#xff09;提交git 商品后臺管理到此已經完成&#xff0c;我們可以把項目提交到公共的環境&#xff0c;原來使用svn&#xff0c;現在使用git 首先在本地創建ssh key&#xff1b; 命令&#xff1a;ssh-keygen -t rsa -C "your_emailyouremail.com" I…

完美解決ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)

已解決ERROR 1045 (28000): Access denied for user ‘root‘‘localhost‘ (using password: NO) 下滑查看解決方法 文章目錄 報錯問題解決思路解決方法交流 報錯問題 ERROR 1045 (28000): Access denied for user ‘root‘‘localhost‘ (using password: NO) 解決思路 對…

InfluxDB v2.x中的Flux基本概念

InfluxDB v2.x中的Flux查詢語言的核心概念主要包括以下幾個方面&#xff1a; 1. 表&#xff08;Tables&#xff09; Flux以表&#xff08;Tables&#xff09;的形式處理數據。每個表包含多行數據&#xff0c;每行數據都是一個record&#xff08;記錄&#xff09;&#xff0c;…

落日余暉映晚霞

落日余暉映晚霞&#xff0c;立于海濱&#xff0c;望夕陽余暉灑于波光粼粼之上&#xff0c;金光跳躍&#xff0c;若繁星閃爍&#xff0c;耀人心目。 海風輕拂&#xff0c;心境寧靜&#xff0c;凡塵俗務皆于此剎那消散&#xff0c;思緒萬干&#xff0c;或憶往昔點滴&#xff0c;或…