{"id":24184,"date":"2017-03-15T16:27:56","date_gmt":"2017-03-15T16:27:56","guid":{"rendered":"http:\/\/ci027cfe65600a26c3"},"modified":"2017-03-15T16:27:56","modified_gmt":"2017-03-15T16:27:56","slug":"security-researcher-found-bug-knocked-out-bitcoin-unlimited","status":"publish","type":"post","link":"https:\/\/bitcoinmagazine.com\/technical\/security-researcher-found-bug-knocked-out-bitcoin-unlimited","title":{"rendered":"This Security Researcher Found the Bug That Knocked Out Bitcoin Unlimited"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><figure><img decoding=\"async\" src=\"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/this-security-researcher-found-the-bug-that-knocked-out-bitcoin-unlimited.jpg\" title=\"\"><\/figure>\n<p>For over a year, attackers have had the ability to crash <a href=\"https:\/\/www.bitcoinunlimited.info\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Unlimited<\/a> and <a href=\"https:\/\/bitcoinclassic.com\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Classic<\/a> nodes. Yesterday, someone actually did it. According to websites like <a href=\"https:\/\/coin.dance\/nodes\/unlimited\" target=\"_blank\" rel=\"noopener\">Coin Dance<\/a>, the number of Bitcoin Unlimited nodes fell sharply from almost 800 to less than 250 in a matter of hours. Bitcoin Classic was hit shortly after.<\/p>\n<p>One day earlier, the security researcher who found the vulnerability had reached out to <em>Bitcoin Magazine<\/em>.<\/p>\n<p>\u201cI am quite beside myself at how a project that aims to power a $20 billion network can make beginner\u2019s mistakes like this.\u201d<\/p>\n<p><strong>The Vulnerabilities<\/strong><\/p>\n<p>Bitcoin Unlimited and Bitcoin Classic are forks of <a href=\"https:\/\/bitcoincore.org\/\" target=\"_blank\" rel=\"noopener\">Bitcoin Core<\/a> that intend to increase Bitcoin\u2019s block size limit. Both launched in 2015 and have been maintained by their own development teams since. While Bitcoin Classic was a relatively popular alternative to Bitcoin Core last year, Bitcoin Unlimited has been gaining traction lately. The world\u2019s largest mining pool \u2014 <a href=\"https:\/\/www.antpool.com\/\" target=\"_blank\" rel=\"noopener\">AntPool<\/a> \u2014<a href=\"https:\/\/www.bloomberg.com\/news\/articles\/2017-03-13\/bitcoin-miners-signal-revolt-in-push-to-fix-sluggish-blockchain\" target=\"_blank\" rel=\"noopener\"> announced<\/a> it would switch to Bitcoin Unlimited, as have <a href=\"https:\/\/bitcoinmagazine.com\/articles\/where-bitcoin-mining-pools-stand-on-segregated-witness-1480086424\">several smaller pools<\/a>.<\/p>\n<p>But not everyone believes that is a good idea.<\/p>\n<p>\u201cI am rather dismayed at the poor level of code quality in Bitcoin Unlimited and I suspect there [is] a raft of other issues,\u201d a security researcher identifying herself only as \u201cCharlotte Gardner\u201d told <em>Bitcoin Magazine<\/em> on Monday. <\/p>\n<p>Communicating over email, Gardner said she was auditing the software for her own use, but quickly came to the conclusion that it\u2019s highly unsafe: \u201cWhat concerns me is that this software is now being used by a huge portion of the Bitcoin mining ecosystem.\u201d<\/p>\n<p>Gardner revealed that she had submitted two vulnerabilities \u2014 \u201ccritical remote crash vulnerabilities\u201d to be exact \u2014 to the Bitcoin Unlimited development team.<\/p>\n<p>The first one is known as a \u201c<a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/476.html\" target=\"_blank\" rel=\"noopener\">NULL pointer dereference<\/a>,\u201d the second a \u201c<a href=\"https:\/\/cwe.mitre.org\/data\/definitions\/617.html\" target=\"_blank\" rel=\"noopener\">reachable assertion<\/a>.\u201d In both cases, attackers can send especially crafted messages to Bitcoin Unlimited or Bitcoin Classic nodes to make these nodes crash. On an open peer-to-peer network like Bitcoin\u2019s, this means that an attacker can get a list of Bitcoin Unlimited and Bitcoin Classic nodes from publicly available sources, like <a href=\"https:\/\/bitnodes.io\/nodes\/?q=\/BitcoinUnlimited:1.0.0.1\/\" target=\"_blank\" rel=\"noopener\">Bitnodes<\/a>, and simply knock every single one of them offline.<\/p>\n<p>\u201cI\u2019m surprised no one has noticed them yet,\u201d Gardner told <em>Bitcoin Magazine<\/em> one day before the attack took place. \u201cI guess not many people actually use the Bitcoin Unlimited software. But with their \u2018rise,\u2019 attackers may take more interest.\u201d<\/p>\n<p><strong>The Disclosure<\/strong><\/p>\n<p>When contacting <em>Bitcoin Magazine<\/em> on Monday, Gardner did not immediately want to make the vulnerabilities public. That would have been irresponsible, she explained, as the bugs could still be exploited before the Bitcoin Unlimited development team had the chance to fix it.<\/p>\n<p>But she did also submit the vulnerabilities to <a href=\"https:\/\/cve.mitre.org\/\" target=\"_blank\" rel=\"noopener\">Mitre\u2019s Common Vulnerabilities and Exposures (CVE) database<\/a>. This ensures that Mitre discloses the bugs in one month from now, which pressures the developers to actually fix the problem in time.<\/p>\n<p>However, even following this responsible disclosure, Gardner thought there was a risk that the vulnerabilities would be abused as soon as they were fixed in the Bitcoin Unlimited code repository. After all, at that point the problem isn\u2019t really solved: anyone running the released Bitcoin Unlimited software is still vulnerable until they download and run the new, revised version. This opens a window for attackers.<\/p>\n<p>\u201cThe problem is, the bugs are so glaringly obvious that when fixing it, it will be easy to notice for anyone watching their development process,\u201d she said.<\/p>\n<p>It now appears that is exactly what has happened. While the Bitcoin Unlimited developers did indeed fix the issue shortly after it was pointed out to them, they did so with far too conspicuous a GitHub <a href=\"https:\/\/github.com\/BitcoinUnlimited\/BitcoinUnlimited\/pull\/371\/commits\/99d4062c570471d43b36b2ad0d416f36817a1743\" target=\"_blank\" rel=\"noopener\">commit message<\/a>, Gardner told <em>Bitcoin Magazine<\/em> once it appeared the bugs seemed fixed and before the attacks began.<\/p>\n<p>\u201cTheir commit message does ring alarm bells. I\u2019m not sure if anyone will notice, but they probably should have obfuscated the message a bit more. The wording might attract closer scrutiny. But if it went unnoticed for this long, maybe it will go unnoticed.\u201d<\/p>\n<p>Clearly, it did not.<\/p>\n<p>As Gardner warned, it didn\u2019t take long for attackers to exploit one of the vulnerabilities: the first attacks <a href=\"http:\/\/pbs.twimg.com\/media\/C66GImZWkAE74sD.jpg\" target=\"_blank\" rel=\"noopener\">happened<\/a> shortly after the bugs were fixed. A little later, user \u201cshinobimonkey\u201d took the issue to <a href=\"https:\/\/www.reddit.com\/r\/Bitcoin\/comments\/5zdkv3\/bitcoin_unlimited_remote_exploit_crash\/\" target=\"_blank\" rel=\"noopener\">Reddit<\/a>, Bitcoin Core developer Peter Todd <a href=\"https:\/\/twitter.com\/peterktodd\/status\/841702092687450113\" target=\"_blank\" rel=\"noopener\">tweeted<\/a> about the bug and social media blew up. <\/p>\n<p>Someone then even published <a href=\"https:\/\/ghostbin.com\/paste\/36hhq\" target=\"_blank\" rel=\"noopener\">exploit code<\/a> for anyone to use, and before long most Bitcoin Unlimited nodes were down, to be followed by many Bitcoin Classic nodes. <\/p>\n<p>\u201cThis is exactly why there is supposed to be a \u2018responsible disclosure\u2019 protocol,\u201d Gardner told <em>Bitcoin Magazine<\/em> after the attacks took place. \u201cBut then it doesn\u2019t help if the software project is not discreet about fixing critical issues like this.\u201d<\/p>\n<p><strong>Code Quality<\/strong><\/p>\n<p>This is not the first time the code quality of Bitcoin Unlimited or Bitcoin Classic has been scrutinized.<\/p>\n<p>As the best-known example, the <a href=\"http:\/\/mining.bitcoin.comindex_en.html\/\" target=\"_blank\" rel=\"noopener\">bitcoin.com<\/a> mining pool, which runs Bitcoin Unlimited, mined an <a href=\"https:\/\/www.reddit.com\/r\/Bitcoin\/comments\/5qwtr2\/bitcoincom_loses_132btc_trying_to_fork_the\/\" target=\"_blank\" rel=\"noopener\">invalid block<\/a> caused by a bug last January. All energy invested to produce the block was wasted, while <a href=\"https:\/\/bitcoinmagazine.com\/bitcoin-mining\/what-are-bitcoin-mining-pools\">mining pools<\/a> that <a href=\"https:\/\/bitcoinmagazine.com\/articles\/why-bitcoin-mining-pools-aren-t-incentivized-to-broadcast-blocks-quickly-1475249510\">spy mined<\/a> on top of the invalid block wasted some energy as well.<\/p>\n<p>Before that, Bitcoin Core developers had already warned about buggy code on several occasions. On the Bitcoin-development mailing list, Matt Corallo <a href=\"https:\/\/lists.linuxfoundation.org\/pipermail\/bitcoin-dev\/2016-October\/013241.html\" target=\"_blank\" rel=\"noopener\">said<\/a> that he had found Bitcoin Classic\u2019s flexible transactions codebase to be \u201criddled with blatant and massive security holes.\u201d On Reddit, Gregory Maxwell <a href=\"https:\/\/www.reddit.com\/r\/Bitcoin\/comments\/5dkb6o\/a_short_tour_of_bitcoin_core\/da5d3x3\/\" target=\"_blank\" rel=\"noopener\">pointed out<\/a> that Bitcoin Unlimited nodes were crashing because the development team removed code that shouldn\u2019t have been removed.<\/p>\n<p>Addressing Bitcoin Unlimited lead developer Andrew Stone in response to yesterday\u2019s events, Maxwell <a href=\"https:\/\/www.reddit.com\/r\/btc\/comments\/5zdrru\/peter_todd_bu_remote_crash_dos_wtf_bug_assert0_in\/dexfs5l\/\" target=\"_blank\" rel=\"noopener\">suggested<\/a> there are more problems with Bitcoin Unlimited\u2019s codebase that have not yet been abused:<\/p>\n<p>\u201cThere are vulnerabilities in Unlimited which have been privately reported to you in Unlimited by Bitcoin Core folks which you have not acted on, sadly. More severe than this one, in fact.\u201d<\/p>\n<p>Perhaps the main problem for Bitcoin Unlimited, as <a href=\"https:\/\/twitter.com\/i\/moments\/841932734465495041\" target=\"_blank\" rel=\"noopener\">pointed out<\/a> by information security expert Andreas Antonopoulos, is that it lacks a significant development community to perform proper quality analysis. The number of developers working on Bitcoin Unlimited and Bitcoin Classic is relatively small, and the code that included the exploited vulnerability was merged after being reviewed by only one person \u2014 not a lot for security-critical code protecting people\u2019s money.<\/p>\n<p>Gardner agreed with this assessment:<\/p>\n<p>\u201cIn this case, the vulnerabilities are so glaringly obvious, it is clear no one has audited their code because these stick out like a sore thumb,\u201d she said. \u201cI\u2019m astounded the mining industry are running this software. But since they are, and a lot of people could get harmed, the best I can do, other than recommending they don\u2019t use Bitcoin Unlimited, is to disclose the issues and hope they are competent enough to fix it.\u201d<\/p>\n<p><em>Bitcoin Magazine<\/em> reached out to Bitcoin Unlimited developers Andrew Stone and Andrea Suisani, but received no response at time of publication.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For over a year, attackers have had the ability to crash Bitcoin Unlimited and Bitcoin Classic nodes. Yesterday, someone actually did it. According to websites like Coin Dance, the number of Bitcoin Unlimited nodes fell sharply from almost 800 to less than 250 in a matter of hours. Bitcoin Classic was hit shortly after. One [&hellip;]<\/p>\n","protected":false},"author":2509,"featured_media":24185,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[3572,3568,2606,124,330],"class_list":{"0":"post-24184","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-technical","8":"tag-bitcoin-classic","9":"tag-bitcoin-unlimited","10":"tag-hacks","11":"tag-nodes","12":"tag-security"},"author_data":{"id":2509,"name":"Aaron van Wirdum","nicename":"aaron-van-wirdum","avatar_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/12\/aaron-van-wirdum-96x96.jpg"},"featured_image_url":"https:\/\/bitcoinmagazine.com\/wp-content\/uploads\/2024\/11\/this-security-researcher-found-the-bug-that-knocked-out-bitcoin-unlimited.jpg","_links":{"self":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/24184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/users\/2509"}],"replies":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/comments?post=24184"}],"version-history":[{"count":0,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/posts\/24184\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media\/24185"}],"wp:attachment":[{"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/media?parent=24184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/categories?post=24184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bitcoinmagazine.com\/wp-json\/wp\/v2\/tags?post=24184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}