Safeguard
Vulnerability Analysis

event-stream (2018): When a Maintainer Handoff Became a Supply Chain Attack

A factual account of the 2018 event-stream npm compromise, in which a new maintainer added a malicious dependency targeting a specific cryptocurrency wallet, and what it revealed about maintainer-trust risk.

Safeguard Research Team
2 min read

event-stream (2018): When a Maintainer Handoff Became a Supply Chain Attack

Summary

In November 2018, the widely used npm package event-stream (millions of weekly downloads at the time) was found to contain malicious code introduced through a new dependency, flatmap-stream. The payload specifically targeted the Copay bitcoin wallet application, attempting to steal wallet credentials and private keys.

Technical Root Cause

The original maintainer, no longer actively using or maintaining the package, transferred publishing rights to a volunteer who had offered to take it over. That new maintainer published a version adding flatmap-stream as a dependency, which contained an encrypted payload that only decrypted and activated under specific conditions matching the Copay build environment. The targeting was deliberately narrow, which delayed detection.

No software vulnerability was exploited. The attack succeeded entirely through legitimate package publishing by an account with legitimate permissions, obtained through social engineering of an overworked volunteer maintainer.

OWASP / CWE Mapping

  • OWASP A08:2021: Software and Data Integrity Failures
  • CWE-506: Embedded Malicious Code
  • Related to CWE-1357 (reliance on insufficiently trustworthy component)

Why It Mattered

event-stream is a clear demonstration that a dependency's risk is not only a function of its code quality or CVE history, but of who currently controls its publishing rights, something most dependency tooling of the era did not surface at all. A package with zero known CVEs and a long clean history became an attack vector overnight through a change in human control.

Lasting Impact

The incident is a major reference point in discussions about open-source maintainer burnout as a security problem, and contributed to npm adding features around publishing controls and provenance. It foreshadowed the same pattern that appeared at larger scale in the XZ Utils backdoor six years later.

How Safeguard Helps

Safeguard's supply chain risk analysis considers signals beyond known CVEs, including dependency provenance and change patterns, since the event-stream class of attack is invisible to a scanner that only matches versions against a vulnerability database.

References

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.