請用此 Handle URI 來引用此文件:
http://tdr.lib.ntu.edu.tw/jspui/handle/123456789/86134
標題: | 探討以太坊代理合約所引發的安全問題 Investigating New Security Issues Introduced by Ethereum Proxy Contracts |
作者: | Wen-Yi Chu 朱玟嶧 |
指導教授: | 蕭旭君(Hsu-Chun Hsiao) |
關鍵字: | 代理合約,邏輯合約,可升級性,安全,區塊鏈, proxy contract,logic contract,upgradability,security,blockchain, |
出版年 : | 2022 |
學位: | 碩士 |
摘要: | 由於區塊鏈的不可更改性,智能合約一旦發布後,開發者便無法修正含有漏洞的智能合約,為了能夠讓開發者修正已經發布的智能合約,因此而產生了代理模式的開發方式。代理合約負責儲存一個智能合約的地址,而實際上執行的程式邏輯都在這一個智能合約中,當我們要修正智能合約時,我們只要更改代理合約儲存的地址,即可讓代理合約執行另一個智能合約的程式邏輯,達到修正漏洞的效果。然而,這樣的開發方式也帶來了新的安全問題,分別是函數名稱衝突以及儲存位置衝突。為了探討代理合約在以太坊上面的影響,我們製作了一個分析代理合約的工具 ProxyChecker。我們使用 ProxyChecker 分析六段時間的智能合約,並發現代理合約有越來越多的趨勢,從 2017 年的 1% 到 2022 年的 88%。在這些代理合約中,大部分都有函數名稱衝突的問題,另外有 0 到 3% 有儲存位置衝突的問題。在論文最後,我們提出一些針對代理合約建議的使用方式給開發者和使用者。我們認為使用代理合約最安全的方式是建立自己的代理合約,像是建立自己的代理合約錢包,但是這與代理合約想要升級有問題的合約這個初衷不符。我們認為透過延遲升級的方式可以達到安全和使用性上的平衡。 The immutable feature of blockchains prevents developers from fixing buggy smart contracts. Consequently, the concept of proxy pattern has emerged to support upgradability. By putting the actual program logic into a secondary contract called a logic contract, a proxy contract can be upgraded by switching to a different logic contract. However, the proxy pattern also brings two security issues, function collisions and storage collisions. To examine the effect of proxy contracts on the Ethereum mainnet, we created a tool named ProxyChecker for analyzing proxy contracts. Using ProxyChecker, we analyzed contracts within six block ranges and found that proxy contracts have become more prevalent, from 1% in 2017 to 88% in 2022. Among these proxy contracts we found, the majority have function collisions, and about 0-3% have storage collisions. Lastly, we provide suggestions for developers and users. Although the most secure way to use proxy contracts is for personal use only, such as constructing wallet contracts, this contradicts the original motivation of introducing them, that is, for upgrading and fixing buggy contracts. We concluded that a delayed upgrade might provide a good balance between security and functionality. |
URI: | http://tdr.lib.ntu.edu.tw/jspui/handle/123456789/86134 |
DOI: | 10.6342/NTU202203210 |
全文授權: | 同意授權(全球公開) |
電子全文公開日期: | 2022-09-12 |
顯示於系所單位: | 資訊工程學系 |
文件中的檔案:
檔案 | 大小 | 格式 | |
---|---|---|---|
U0001-0609202223505900.pdf | 689.78 kB | Adobe PDF | 檢視/開啟 |
系統中的文件,除了特別指名其著作權條款之外,均受到著作權保護,並且保留所有的權利。