請用此 Handle URI 來引用此文件:
http://tdr.lib.ntu.edu.tw/jspui/handle/123456789/86134
完整後設資料紀錄
DC 欄位 | 值 | 語言 |
---|---|---|
dc.contributor.advisor | 蕭旭君(Hsu-Chun Hsiao) | |
dc.contributor.author | Wen-Yi Chu | en |
dc.contributor.author | 朱玟嶧 | zh_TW |
dc.date.accessioned | 2023-03-19T23:38:28Z | - |
dc.date.copyright | 2022-09-12 | |
dc.date.issued | 2022 | |
dc.date.submitted | 2022-09-07 | |
dc.identifier.citation | [1] Python Software Foundation. Python. https://www.python.org/. [2] Aragon Association. Aragon. https://aragon.org/. [3] Audius Inc. Audius. https://audius.co/. [4] Audius Inc. Audius governance takeover postmortem 7/23/22. https://blog.audius.co/article/audius-governance-takeover-post-mortem-7-23-22. [5] Authereum Inc. Authereum. https://authereum.com/. [6] BitGo Inc. Ethereum multisig wallet contract. https://github.com/BitGo/eth-multisig-v2. [7] T. Chen, Z. Li, X. Luo, X. Wang, T. Wang, Z. He, K. Fang, Y. Zhang, H. Zhu, H. Li, Y. Cheng, and X.-s. Zhang. Sigrec: Automatic recovery of function signatures in smart contracts. IEEE Transactions on Software Engineering, pages 1–1, 2021. [8] Consensys Inc. Mythril. https://github.com/ConsenSys/mythril. [9] David, S. Understanding the dao attack. https://www.coindesk.com/learn/2016/06/25/understanding-the-dao-attack/. [10] M. di Angelo and G. Slazer. Wallet contracts on ethereum. In 2020 IEEE International Conference on Blockchain and Cryptocurrency (ICBC), pages 1–2, 2020. [11] EOSIO Inc. Eos. https://eos.io/. [12] Ethereum Alarm Clock. Ethereum alarm clock. https://www.ethereum-alarm-clock.com/. [13] Ethereum community. Opcodes for the evm. https://ethereum.org/en/developers/docs/evm/opcodes/. [14] EtherScan Team. Etherscan. https://etherscan.io/. [15] ethervm@gmail.com. Online solidity decompiler. https://ethervm.io/decompile. [16] J. Feist, G. Greico, and A. Groce. Slither: A static analysis framework for smart contracts. In Proceedings of the 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain, WETSEB ’19, page 8–15. IEEE Press, 2019. [17] foundation Inc. Foundation. https://foundation.app/. [18] Infura Inc. Infura. https://infura.io/. [19] P. Klinger, L. Nguyen, and F. Bodendorf. Upgradeability concept for collaborative blockchain-based business process execution framework. In International Conference on Blockchain, pages 127–141. Springer, 2020. [20] C. Liu, H. Liu, Z. Cao, Z. Chen, B. Chen, and B. Roscoe. Reguard: Finding reentrancy bugs in smart contracts. In Proceedings of the 40th International Conference on Software Engineering: Companion Proceeedings, ICSE ’18, page 65–68, New York, NY, USA, 2018. Association for Computing Machinery. [21] M. Mossberg, F. Manzano, E. Hennenfent, A. Groce, G. Grieco, J. Feist, T. Brunson, and A. Dinaburg. Manticore: A user-friendly symbolic execution framework for binaries and smart contracts. In 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 1186–1189, 2019. [22] MYKEY Lab. Mykey lab. https://mykey.org/. [23] Neo Inc. Neo. https://neo.org/. [24] R. Norvill, B. B. F. Pontiveros, R. State, and A. Cullen. Visual emulation for ethereum’s virtual machine. In NOMS 2018 - 2018 IEEE/IFIP Network Operations and Management Symposium, pages 1–4, 2018. [25] OpenZeppelin Inc. Proxy upgrade pattern. https://docs.openzeppelin.com/upgrades-plugins/1.x/proxies. [26] OpenZeppelin Inc. Safemath. https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol. [27] Ozone Networks Inc. Opensea. https://opensea.io/. [28] P. Ventuzelo. Octopus. https://github.com/pventuzelo/octopus. [29] QuickNode Inc. Quicknode. https://www.quicknode.com/. [30] Rekt DAO. Rekt. https://rekt.news/. [31] Solidity community. Solidity official document. https://docs.soliditylang.org/. [32] The go-ethereum Authors. Go ethereum. https://geth.ethereum.org/. [33] C. F. Torres, A. K. Iannillo, A. Gervais, and R. State. Confuzzius: A data dependency-aware hybrid fuzzer for smart contracts. In 2021 IEEE European Symposium on Security and Privacy (EuroS&P), pages 103–119, 2021. [34] Trail of Bits Inc. rattle. https://github.com/crytic/rattle. [35] Vyper community. Vyper official document. https://vyper.readthedocs.io/en/stable/. [36] Wyvern Protocol team. Wyvern protocol. https://wyvernprotocol.com/. [37] Yiedld App Inc. Yield. https://www.yield.app/. [38] G. Zheng, L. Gao, L. Huang, and J. Guan. Upgradable contract. In Ethereum Smart Contract Development in Solidity, pages 197–213. Springer, 2021. | |
dc.identifier.uri | http://tdr.lib.ntu.edu.tw/jspui/handle/123456789/86134 | - |
dc.description.abstract | 由於區塊鏈的不可更改性,智能合約一旦發布後,開發者便無法修正含有漏洞的智能合約,為了能夠讓開發者修正已經發布的智能合約,因此而產生了代理模式的開發方式。代理合約負責儲存一個智能合約的地址,而實際上執行的程式邏輯都在這一個智能合約中,當我們要修正智能合約時,我們只要更改代理合約儲存的地址,即可讓代理合約執行另一個智能合約的程式邏輯,達到修正漏洞的效果。然而,這樣的開發方式也帶來了新的安全問題,分別是函數名稱衝突以及儲存位置衝突。為了探討代理合約在以太坊上面的影響,我們製作了一個分析代理合約的工具 ProxyChecker。我們使用 ProxyChecker 分析六段時間的智能合約,並發現代理合約有越來越多的趨勢,從 2017 年的 1% 到 2022 年的 88%。在這些代理合約中,大部分都有函數名稱衝突的問題,另外有 0 到 3% 有儲存位置衝突的問題。在論文最後,我們提出一些針對代理合約建議的使用方式給開發者和使用者。我們認為使用代理合約最安全的方式是建立自己的代理合約,像是建立自己的代理合約錢包,但是這與代理合約想要升級有問題的合約這個初衷不符。我們認為透過延遲升級的方式可以達到安全和使用性上的平衡。 | zh_TW |
dc.description.abstract | 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. | en |
dc.description.provenance | Made available in DSpace on 2023-03-19T23:38:28Z (GMT). No. of bitstreams: 1 U0001-0609202223505900.pdf: 706336 bytes, checksum: afbfe167347c74a39cf1bac3c9cf1050 (MD5) Previous issue date: 2022 | en |
dc.description.tableofcontents | Verification Letter from the Oral Examination Committee i 致謝 ii 摘要 iii Abstract iv Contents vi List of Figures ix List of Tables x List of Algorithms xi Chapter 1 Introduction 1 Chapter 2 Background 6 2.1 EVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.2 EVM Opcode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3 EVM Storage Layout . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.4 Function Signature . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.5 Fallback Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.6 Ethereum Improvement Proposals . . . . . . . . . . . . . . . . . . . 9 Chapter 3 Related Work 12 3.1 Smart Contract Analysis Tools . . . . . . . . . . . . . . . . . . . . . 12 3.2 Ethereum Virtual Machine Emulator . . . . . . . . . . . . . . . . . . 13 3.2.1 Go-Ethereum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.2 E-EVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.3 Proxy Contract Related . . . . . . . . . . . . . . . . . . . . . . . . . 14 Chapter 4 Security Issues 15 4.1 Definition of Proxy Contracts . . . . . . . . . . . . . . . . . . . . . 15 4.2 Function Collisions . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.3 Storage Collisions . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Chapter 5 PROXYCHECKER: Design and Implementation 21 5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.2 Delegatecall Detector . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.3 Dynamic Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 5.3.1 Create a Calldata . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.3.2 Dynamically Analyze and Extract the Parameters . . . . . . . . . . 26 5.3.3 Compare the Calldata . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.4 Contract Checker . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Chapter 6 Data Collection and Analysis Result 34 Chapter 7 In-depth Analysis 41 7.1 Logic Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 7.2 Proxy Contracts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 7.3 Other Findings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Chapter 8 DISCUSSION 50 8.1 Mitigation for Security Issues . . . . . . . . . . . . . . . . . . . . . 50 8.2 Proxy Contract Usage . . . . . . . . . . . . . . . . . . . . . . . . . 52 8.3 Limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Chapter 9 CONCLUSION 55 References 57 | |
dc.language.iso | en | |
dc.title | 探討以太坊代理合約所引發的安全問題 | zh_TW |
dc.title | Investigating New Security Issues Introduced by Ethereum Proxy Contracts | en |
dc.type | Thesis | |
dc.date.schoolyear | 110-2 | |
dc.description.degree | 碩士 | |
dc.contributor.oralexamcommittee | 陳昱圻(Yu-Chi Chen),廖世偉(Shih-wei Liao),郭博鈞(Po-Chun Kuo) | |
dc.subject.keyword | 代理合約,邏輯合約,可升級性,安全,區塊鏈, | zh_TW |
dc.subject.keyword | proxy contract,logic contract,upgradability,security,blockchain, | en |
dc.relation.page | 60 | |
dc.identifier.doi | 10.6342/NTU202203210 | |
dc.rights.note | 同意授權(全球公開) | |
dc.date.accepted | 2022-09-07 | |
dc.contributor.author-college | 電機資訊學院 | zh_TW |
dc.contributor.author-dept | 資訊工程學研究所 | zh_TW |
dc.date.embargo-lift | 2022-09-12 | - |
顯示於系所單位: | 資訊工程學系 |
文件中的檔案:
檔案 | 大小 | 格式 | |
---|---|---|---|
U0001-0609202223505900.pdf | 689.78 kB | Adobe PDF | 檢視/開啟 |
系統中的文件,除了特別指名其著作權條款之外,均受到著作權保護,並且保留所有的權利。