UPDATED 19:55 EDT / NOVEMBER 26 2018

SECURITY

Bitcoin-stealing code inserted into popular GitHub-hosted JavaScript library

A hacker has successfully inserted bitcoin-stealing code into a popular JavaScript library used by millions including leading companies.

The hack involved the insertion of code into Event-Stream, a JavaScript npm package for working with Node.js streaming data hosted on GitHub with the aim of intercepting bitcoin payments on BitPay’s open-source bitcoin wallet Copay.

Where the story gets interesting is an apparent breakdown in JavaScript library management security starting at the top.

Event-Stream, which is a toolkit designed to make creating and working with streams easy, was first written by a coder called Dominic Tarr, who later gave up on its development despite its popularity.

About three months ago, Tarr gave management rights to the Event-Stream repository to someone by the name of Right9ctrl, and that’s when the code was compromised.

On Sept. 9, version 3.3.6 was published complete with a benign module called flatmap-stream, seemingly as a test to see if anyone would notice a new module. On Oct. 5, the flatmap-stream module was then altered to include malicious code that attempted to steal bitcoin wallets and transfer their balances to a server located in Kuala Lumpur, according to Ars Technica.

The crypto stealing code was subsequently discovered Nov. 20 when a user posted details on the script asking what it was and what was it doing.

The story raises questions about both the risks companies take in using open-source code as well as the security of code repositories themselves.

For years, security researchers have been warning of the risks of using open-source code in larger projects. Open-source repository GitHub, now owned by Microsoft Corp., has also had its own issues.

That a highly popular library was simply handed over to someone with seemingly little to no history on GitHub is where the security considerations come in. GitHub does entrust existing code developers to make decisions on who should be in control of projects but in this case, access was handed over to some will nefarious intent with absolutely zero checks and balances.

“Nothing’s stopping this happening again, and it’s terrifying,” software engineer Chris Northwood wrote on Medium. “The Hacker News and GitHub threads on the issue quickly denigrated into a blame game, pulling out license clauses and debating what open source etiquette means. However, this is no one person’s fault, it’s a systemic failure that has led to this.”

Photo: 48598045@N07/Flickr

A message from John Furrier, co-founder of SiliconANGLE:

Your vote of support is important to us and it helps us keep the content FREE.

One click below supports our mission to provide free, deep, and relevant content.  

Join our community on YouTube

Join the community that includes more than 15,000 #CubeAlumni experts, including Amazon.com CEO Andy Jassy, Dell Technologies founder and CEO Michael Dell, Intel CEO Pat Gelsinger, and many more luminaries and experts.

“TheCUBE is an important partner to the industry. You guys really are a part of our events and we really appreciate you coming and I know people appreciate the content you create as well” – Andy Jassy

THANK YOU