Open source package with 1 million monthly downloads stole user credentials

The open-source software ecosystem operates on a foundation of trust that is rarely articulated and almost never verified. Developers download packages from public registries millions of times per day, executing code written by strangers, on the assumption that the collective scrutiny of the community will catch anything dangerous before it reaches production systems. For the maintainers of a popular npm utility called “devstream-utils” — downloaded more than one million times per month by developers around the world — that trust was systematically exploited for nearly eight months before anyone noticed. The package, used to simplify environment configuration in Node.js applications, had been silently harvesting developer credentials and exfiltrating them to an external server since its 2.4.1 release in August 2025.

The discovery, made by a developer at a mid-sized fintech company in Warsaw who noticed anomalous outbound traffic patterns in their CI/CD pipeline, triggered an investigation by security researchers at open-source security firm Bastion Labs. What they found was a carefully constructed supply-chain compromise: the original maintainer’s npm account had been taken over via credential stuffing — the attacker used a password that had appeared in a previous data breach — and a malicious update was published that appeared, at the package level, virtually identical to the legitimate previous version. The payload was obfuscated across several layers of encoded strings and activated only under specific conditions: when running in a CI/CD environment, when certain environment variable naming patterns were present, and when an active internet connection was detected.

Over eight months, devstream-utils 2.4.1 was installed in the development environments of an estimated 340,000 unique projects. The malicious code specifically targeted SSH keys, npm authentication tokens, environment variables containing patterns associated with cloud provider credentials (AWS_ACCESS_KEY, AZURE_CLIENT_SECRET, GCP_SERVICE_ACCOUNT_KEY), and any.env files accessible to the running process. “The attacker was not indiscriminate,” said Chen Wei, lead researcher at Bastion Labs. “They built a credential harvesting tool designed for maximum yield from developer machines and CI systems. The choice to target CI environments specifically is telling — that is where the most privileged credentials live.”

The scale of potential exposure is difficult to overstate. One million monthly downloads does not translate to one million affected organisations — many downloads represent repeated installations across development, staging, and production environments within the same organisation — but Bastion Labs estimates that tens of thousands of distinct organisations may have been exposed to the malicious version over the eight-month window. The exfiltrated credentials were collected at a server registered under an anonymised hosting provider; by the time investigators identified the endpoint, the attacker had stopped accepting new data and the server had been taken offline, suggesting awareness that discovery was imminent.

npm’s security team acted quickly once notified, unpublishing the malicious version within hours and publishing a security advisory. But the incident exposed the fundamental limitations of the registry’s security model. npm relies heavily on maintainer account security — if an account is compromised, the attacker inherits all publishing privileges for every package that maintainer controls. Two-factor authentication is now mandatory for maintainers of popular packages, a policy npm introduced in 2023, but the original devstream-utils maintainer had not updated their authentication settings since before that policy took effect, and the enforcement mechanism failed to block the malicious publish. “Account security hygiene in the open-source community is genuinely mixed,” said Dr. Priya Nair, a software supply-chain security researcher at the National University of Singapore. “We have thousands of packages with millions of users that depend on a single maintainer’s password practices.”

The incident has prompted calls for more aggressive use of package signing and provenance verification. npm’s Sigstore integration, which allows package publishers to cryptographically sign their releases and tie them to a verifiable build provenance record, has been available since 2024 but adoption remains low — fewer than three percent of npm packages currently publish signed releases. Had devstream-utils used package signing with a hardware security key, the credential-stuffed account takeover would have been insufficient to publish a trusted malicious version. The barrier to adopting these tools is not primarily technical; it is the friction of changing established workflows and the lack of a clear incentive mechanism for individual maintainers to invest time in security tooling that primarily benefits their downstream users.

For development teams consuming open-source packages, the devstream-utils incident offers actionable lessons. Organisations should implement software composition analysis tools that alert when a dependency has been updated, particularly for transitive dependencies that may not be actively monitored. Locking dependency versions in production and treating any version bump as a change requiring review adds friction but substantially reduces exposure to malicious updates. Restricting the permissions available to CI/CD processes — using role-based access controls, short-lived credentials, and secrets management platforms that avoid writing credentials to environment variables — limits the blast radius of any successful compromise. And monitoring outbound network connections from build systems, as the Warsaw fintech developer was doing when they caught this incident, remains an underutilised but effective detective control.

The deeper challenge is structural. Open-source software is a public good produced largely by volunteers and funded inconsistently by the enterprises that profit most from its existence. The devstream-utils package was, by all accounts, a genuinely useful utility maintained conscientiously by a developer who had no security budget, no bug bounty programme, and no organisational support for implementing the kind of account security controls that would have prevented this attack. Addressing that structural deficit — through funding, tooling, policy, and cultural change within the developer community — is the only path to a supply chain that is resilient rather than merely lucky.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top