Due to the open-source nature of the blockchain ecosystem, it is common for new blockchains to fork or partially reuse the code of classic blockchains. For example, the popular Dogecoin, Litecoin, Binance BSC, and Polygon are all variants of Bitcoin/Ethereum. These "forked" blockchains thus could encounter similar vulnerabilities that are propagated from Bitcoin/Ethereum during forking or subsequently commit fetching. In this paper, we conduct a systematic study of detecting and investigating the propagated vulnerabilities in forked blockchain projects. To facilitate this study, we propose BlockScope, a novel tool that can effectively and efficiently detect multiple types of cloned vulnerabilities given an input of existing Bitcoin/Ethereum security patches. Specifically, BlockScope adopts similarity-based code match and designs a new way of calculating code similarity to cover all the syntax-wide variant (i.e., Type-1, Type-2, and Type-3) clones. Moreover, BlockScope automatically extracts and leverages the contexts of patch code to narrow down the search scope and locate only potentially relevant code for comparison. Our evaluation shows that BlockScope achieves good precision and high recall both at 91.8% (1.8 times higher recall than that in ReDeBug). BlockScope allows us to discover 101 previously unknown vulnerabilities in 13 out of the 16 forked projects of Bitcoin and Ethereum, including 16 from Dogecoin, 6 from Litecoin, 1 from Binance, and 4 from Optimism. We have reported all the vulnerabilities to their developers; 40 of them have been patched or accepted, 66 were acknowledged or under pending, and only 4 were rejected. We further investigate the propagation and patching processes of discovered vulnerabilities, and reveal three types of vulnerability propagation from source to forked projects, as well as the long delay (over 200 days) for releasing patches in Bitcoin forks.
翻译:由于链链生态系统的开放源码性质,对于新的链条来说,通常会发现或部分重新使用经典链条的代码。例如,流行的Dogecoin、Litecoin、Binance BSC和Poligon都是Bitcoin/Ethereum的变体。这些“被淘汰”的链条可能会遇到类似的脆弱性,而Bitcoin/Eitherum在前方或后方进行提取时会传播这种脆弱性。在本文中,我们进行一项系统研究,以探测和调查在前方链条项目中传播的脆弱性。为了便利这项研究,我们提议了BlucScope,这是一个新颖的工具,能够有效且高效地检测多种类型的克隆脆弱性,而这是现有的Bitcoin/Eterum安全补丁。具体地说,这些“被淘汰的”链条链条链链条可能会遇到类似的脆弱性,而Bitcoin/Etherum在前方或后方中会传播。对于所有语系变体变体变体的变体(即Tylock-2和Tyle-3)的变体的变体,我们从前方自动提取和变体提取的变体提取的变体,我们从40种解提取的变体提取的变体提取的变体提取的变体变体变体变体,我们从一个变体提取的变体提取的变体开始, 和变体的变体的变体的变体到的变体到的变体,我们的变体和变体的变体到的变体的变体的变体的变体的变体的变体,我们的变体和变体的变体的变体的变体的变体的变体的变体的变体的变体的变体的变体的变体变体变体变体的变体的变体的变体,从前的变体,我们的变体的变体, 将的变体,我们的变体,从前的变体的变体的变体和变体的变体的变体的变体和变体的变体的变体的变体的变体的变体化的变体变体变体变体变体变体变体变体的变体变体的变体的变体