Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Cybercrime

Cryptocurrency-Stealing Code Distributed via Popular Library

The popular EventStream Node.js library was recently modified to fetch malicious code designed to steal crypto-currencies.

Designed as a toolkit to make creating and working with streams easy, the JavaScript package has around two million downloads a week, which makes it a valuable resource to application developers and malicious actors alike.

The popular EventStream Node.js library was recently modified to fetch malicious code designed to steal crypto-currencies.

Designed as a toolkit to make creating and working with streams easy, the JavaScript package has around two million downloads a week, which makes it a valuable resource to application developers and malicious actors alike.

The code library was designed by a Dominic Tarr, who says he hasn’t been using it for years. However, he apparently agreed to transfer the module to another user in September 2018, who modified the library’s dependencies, which eventually resulted in malicious code being delivered to users.

On September 9, the repository’s new maintainer, right9ctrl, added the flatmap-stream library as a dependency of event-stream, but then removed it on September 16, when they also pushed a new version of event-stream, Chris Northwood explains on Medium.

On October 5, NPM user hugeglass pushed flatmap-stream 0.1.1, which had an obfuscated snippet of nefarious code appended to it. The encrypted payload is decrypted if a specific value of description in package.json is present, and was found last week to target a crypto-currency wallet to steal keys.

Specifically, the malicious code in flatmap-stream 0.1.1 was designed to steal coins from Dash Copay Bitcoin, an open-source, multiplatform, multi-signature, secure Bitcoin wallet. The malicious code would only become active when the wallet app is used.

“Currently we have only confirmed that the malicious code was deployed on versions 5.0.2 through 5.1.0 of our Copay and BitPay apps. However, the BitPay app was not vulnerable to the malicious code. We are still investigating whether this code vulnerability was ever exploited against Copay users,” the BitPay Team says in a blog post.

The root cause of the issue is that the original maintainer of event-stream handed over the repository/package to another individual, likely without performing rigorous checks, which eventually resulted in malicious code being added to the library.

Advertisement. Scroll to continue reading.

“The main takeaway with this attack is that in the world of modern software, it’s turtles all the way down… Just because the code you write is secure, doesn’t mean that the code other developers write for you is. The only way to get ahead of this is to practice deep and continuous abuse-case (i.e., security) testing,” Casey Ellis, CTO at Bugcrowd, told SecurityWeek.

This is not the first time popular repositories, especially those that are no longer maintained, end up being abused for malicious purposes. Such was the case with ESLint earlier this year, as well as with numerous WordPress plugins last year.

Related: Backdoored Module Removed from npm Registry

Related: Hackers Exploit Flaw in GDPR Compliance Plugin for WordPress

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Trending

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join the session as we discuss the challenges and best practices for cybersecurity leaders managing cloud identities.

Register

SecurityWeek’s Ransomware Resilience and Recovery Summit helps businesses to plan, prepare, and recover from a ransomware incident.

Register

Expert Insights

Related Content

Cybercrime

The changing nature of what we still generally call ransomware will continue through 2023, driven by three primary conditions.

Cybercrime

A recently disclosed vBulletin vulnerability, which had a zero-day status for roughly two days last week, was exploited in a hacker attack targeting the...

Cybercrime

As it evolves, web3 will contain and increase all the security issues of web2 – and perhaps add a few more.

Cybercrime

Luxury retailer Neiman Marcus Group informed some customers last week that their online accounts had been breached by hackers.

Cybercrime

Zendesk is informing customers about a data breach that started with an SMS phishing campaign targeting the company’s employees.

Cybercrime

Patch Tuesday: Microsoft calls attention to a series of zero-day remote code execution attacks hitting its Office productivity suite.

Artificial Intelligence

The release of OpenAI’s ChatGPT in late 2022 has demonstrated the potential of AI for both good and bad.

Cybercrime

Satellite TV giant Dish Network confirmed that a recent outage was the result of a cyberattack and admitted that data was stolen.