Npm Package Compromise Exposes GitHub Credentials and Cloud Secrets
Multiple npm packages have been compromised, resulting in a series of attacks that harvest GitHub credentials and cloud secrets. The researcher behind this analysis highlighted vulnerabilities within packages from the namespaces of @tanstack, @mistralai, @uipath, @squawk, and safe-action, with over 50 affected releases noted, including critical libraries. This incident mimics previous attack patterns seen in compromises such as those involving Shai-Hulud and [email protected]. The scale of the attack raises concerns about potential future waves of infected packages.
The compromised packages execute a malicious script during installation that retrieves the Bun runtime from GitHub. This script subsequently runs a payload called tanstack_runner.js, which captures GitHub credentials using the command line instruction “gh auth token.” The attack further extends to cloud environments through querying AWS instance metadata and manipulating AWS services to escalate privileges. The payload is designed to delete itself after execution, reducing any potential forensic footprint. This sophisticated methodology allows attackers to leverage stolen credentials for publishing additional compromised npm packages.
For organizations relying on npm packages, this threat is significant, especially those utilizing the affected packages in production environments. Developers and administrators who have integrated any of the compromised versions must be particularly vigilant in auditing their GitHub and AWS accounts for unauthorized access. Ensuring that these credentials are rotated is imperative to mitigate risk from the attack vectors identified.
Defensive Context
Organizations leveraging the affected npm packages should focus their attention on the security of their development environments. The wide usage of impacted libraries means that many companies across different sectors may find themselves at risk. Immediate scrutiny is necessary for teams involved in software development who utilize these libraries, especially when accessing sensitive cloud resources.
Why This Matters
The potential for attackers to publish further compromised packages increases the threat landscape substantially. Developers must be aware that even well-established libraries are not immune to these types of vulnerabilities. Organizations with integrated workflows relying on these packages are directly exposed and need to take immediate action to prevent the loss of sensitive data.
Defender Considerations
Verification of package versions is crucial, specifically for the packages listed in the article. The primary domains of interest include git-tanstack.com, serving as a command-and-control mechanism, as well as codeload.github.com, which was used nefariously. Any instances of the associated hash of the payload (2ec78d556d696e208927cc503d48e4b5eb56b31abc2870c2ed2e98d6be27fc96) should be flagged accordingly. Organizations should closely monitor their environments for any signs of suspicious activity attributable to these compromised packages.
Indicators of Compromise (IOCs)
Domains:
- git-tanstack.com (primary command-and-control)
- codeload.github.com (abused service)
Host Artifacts:
- Payload hash: 2ec78d556d696e208927cc503d48e4b5eb56b31abc2870c2ed2e98d6be27fc96






