A routine package update turned dangerous this week. A malicious release of Tinycolor (a library downloaded millions of times each week) was found to carry code that quietly steals developer credentials and spreads itself to other packages.
While tinycolor is the most visible package, with 2.2 million weekly downloads on npm, it did not originate these compromises, but is one package among dozens trojanized in this active campaign.esearchers first flagged the behavior on 15 September 15. Socket’s team has since traced the campaign across many maintainers and packages.
“The issue was first noticed by Daniel dos Santos Pereira, who flagged suspicious behavior in the latest release. Socket’s automated malware detection also surfaced the threat in 40+ additional packages, and our research team continues to analyze the payload and its distribution method,”Socket said.
The compromise is not limited to tinycolor. Investigators say a trojanized routine called NpmModule.updatePackage was used to download package tarballs, alter package.json, inject a bundle.js post-install script, repackage the archive, and publish the modified version.
That method lets the malware trojanize downstream projects automatically. Socket’s automated detections initially listed more than 40 affected packages. Subsequent analysis shows the campaign expanded dramatically. By 16 September, investigators documented hundreds more affected packages, including some from CrowdStrike.
Simple and Effective
What the payload does is simple and effective. The injected bundle.js fetches a secret-scanner binary (TruffleHog), runs it against the host, and searches for tokens and cloud credentials. If developer or CI tokens are found, the malware validates them and can write a GitHub Actions workflow into .github/workflows.
That workflow can exfiltrate findings to a hardcoded webhook or publish results to a public repository under the victim’s account. The script runs during install, so compromise can happen on a developer laptop or inside CI runners.
Early lists of compromised packages include libraries across many ecosystems and maintainers. Researchers confirmed dozens of affected modules by name and version, from [email protected] to @ctrl/[email protected] and @4.1.2, and many @nativescript-community and @ctrl packages. The pattern is familiar. A single trojanized library that is widely depended upon becomes a wormhole into projects and pipelines.
Why This Matters
Tokens and keys are powerful. A valid NPM_TOKEN or GITHUB_TOKEN can let attackers publish malicious releases, push commits, or reach private package artifacts. Cloud metadata endpoints can yield short-lived credentials from build agents. Once a malicious workflow is committed, every future CI run can replay the theft and widen the blast radius. The campaign’s persistence mechanisms mean removal from a single host may not be enough.
Indicators of compromise have been published by researchers. One notable artifact is the bundle.js SHA-256: 46faab8ab153fae6e80e7cca38eab363075bb524edd79e42269217a083628f09. The attack used a defanged webhook endpoint during testing and exfiltration attempts. If you manage or build software that depends on npm packages, treat those indicators as high priority.
Immediate Steps For Teams
Socket advises teams to:
- Uninstall or pin. Remove affected versions and pin dependencies to known good releases until maintainers publish verified patches.
- Audit machines and CI. Check developer laptops, CI agents, and build servers that ran npm install for signs of the injected script, unexpected commits, or new workflows.
- Rotate tokens. Assume secrets present on any host that installed a compromised package may be exposed. Rotate npm, GitHub, cloud, and other tokens.
- Monitor for misuse. Look for unusual npm publish events, unexpected repo creations, or GitHub Actions runs that include data exfiltration steps.
Context and precedent
Supply-chain attacks against package registries are not new. The npm ecosystem has seen knock-on campaigns before. What sets this one apart is the self-propagating behavior and the use of legitimate secret-scanning tools like TruffleHog as part of the payload. That choice helps the malware mask its intent while it hunts for valid credentials. Multiple security vendors and research groups have since flagged related incidents as the situation unfolded.
A final note of caution. Open source depends on trust. Maintain that trust by reducing blast radius. Enforce least privilege on publishing tokens. Require fine-grained scopes. Use ephemeral credentials for CI when possible. Review third-party dependencies. Use registry-level protections and automated scanning, but do not treat those as the last line of defense.
Researchers promise a fuller technical analysis and remediation guide as they finish their investigations. For now, treat this like a live incident and respond accordingly.
The Escalating Sophistication of Adversaries
Mike McGuire, Senior Security Solutions Manager at Black Duck, says this latest supply chain attack highlights the escalating sophistication of adversaries targeting open source ecosystems. “By injecting malicious code via bundle.js to weaponize legitimate tools like TruffleHog for credential theft, and even enabling self-propagation through automated republishing of downstream packages, attackers are exploiting the inherent trust developers place in registries like npm. This not only compromises individual developer environments but can cascade into broader CI/CD pipelines, exfiltrating sensitive tokens and secrets that persist long after the initial infection.”
McGuire says incidents like this (codenamed Shai-Hulud)serve as a reminder that software supply chains are only as strong as their weakest links. “Organizations must adopt a proactive defense-in-depth approach: implementing automated software composition analysis (SCA) to continuously monitor dependencies for vulnerabilities and malicious behavior, enforcing strict package verification and provenance checks, and rotating credentials immediately upon detection of compromise. Within my organization, we’ve seen a surge in such attacks, and without robust tools to map and secure your open source footprint, the risks to sensitive information, intellectual property, and operational integrity are simply too high to ignore.”
Blurring the Lines Between Legitimate Tooling and Abuse
This incident underscores how the modern software supply chain can be turned against developers themselves, adds Randolph Barr, Chief Information Security Officer at Cequence Security. “By trojanizing upstream packages and embedding tools like TruffleHog for credential harvesting, attackers are blurring the line between legitimate tooling and abuse. This isn’t just about code quality, it’s about trust in the entire CI/CD pipeline.”
While organizations without a dedicated API security platform or runtime supply chain monitoring may feel limited, Barr says there are still practical, high-impact actions they can take:
- Pin dependencies to avoid unexpected package updates
- Use tools like Snyk or OWASP Dependency-Check for SCA
- Scan commits with Gitleaks or TruffleHog to prevent hardcoded secrets
- Validate tokens using scoped access policies
- Review build agent privileges to avoid overly broad access
- Implement centralized logging to detect credential scanning or metadata probing
He says for runtime protection, even basic API gateway controls like rate limiting, IP filtering, and destination validation can help flag suspicious activity. “Security teams must look beyond static scanning and adopt runtime validation techniques that detect destination drift, unapproved dependency behavior, and anomalous access to cloud metadata services.”
This is a reminder that secrets aren’t just leaked, they’re actively hunted through automation. Defenders must match that speed with automated guardrails, developer hygiene, and visibility across the pipeline, adds McGuire.
Among the Most Dangerous Threats
Shane Barney, Chief Information Security Officer at Keeper Security says software supply chain attacks are among the most dangerous threats facing organizations because they exploit the inherent trust placed in widely used tools and dependencies. “This incident, which injected malicious code into npm packages to scan for and steal developer credentials, demonstrates how quickly a single compromised component can ripple across an ecosystem and become an entry point for wider breaches.”
These attacks are not anomalies, adds Barney. “They will continue as long as the attack vector remains viable. Organizations need to understand exactly what is in their software environments and be ready to act when something goes wrong. That means auditing dependencies, incorporating Software Bills of Materials (SBOMs) to provide transparency and enable quick vulnerability assessments, enforcing strong authentication and access controls through privileged access management, monitoring for anomalous behavior, and protecting secrets so that stolen credentials cannot be weaponized.”
These practices are essential to resilience, he adds. “They reduce the blast radius of an attack and allow businesses to maintain trust even when supply chain compromises occur.”
Information Security Buzz News Editor
Kirsten Doyle has been in the technology journalism and editing space for nearly 24 years, during which time she has developed a great love for all aspects of technology, as well as words themselves. Her experience spans B2B tech, with a lot of focus on cybersecurity, cloud, enterprise, digital transformation, and data centre. Her specialties are in news, thought leadership, features, white papers, and PR writing, and she is an experienced editor for both print and online publications.
The opinions expressed in this post belong to the individual contributors and do not necessarily reflect the views of Information Security Buzz.


