TL;DR: A malicious npm package, mouse5212-super-formatter, exfiltrated local files to GitHub while leaking its own private token, leaving researchers able to trace activity and confirm around seven active exfiltration events before takedown, according to OXSecurity. The case shows how compromised non-human identities and sloppy operational security turn package installs into data-theft channels, not just code-execution events.
NHIMG editorial — based on content published by OXSecurity: malicious npm infostealer exposed its own GitHub token
By the numbers:
- The malware reached 676 downloads, and is still live on npm at time of publishing.
- When AWS credentials are exposed publicly, attackers attempt access within an average of 17 minutes.
Questions worth separating out
Q: What breaks when a malicious package can use a GitHub token to exfiltrate files?
A: The main failure is that package installation becomes an authenticated data-transfer path.
Q: Why do exposed GitHub tokens increase risk beyond the initial malware infection?
A: Because the token is a reusable non-human identity credential, not a one-time exploit.
Q: How do security teams detect package-based data exfiltration in practice?
A: Look for linked signals across process, file, and network telemetry.
Practitioner guidance
- Revoke exposed GitHub tokens immediately Inventory all GitHub tokens used by developers, CI jobs, and automation, then revoke any credential that could create repositories or write content.
- Scan package-install workflows for unexpected file egress Monitor post-install hooks, recursive file reads, and API writes to GitHub or other remote services.
- Restrict token fallback paths in build and developer tooling Remove hardcoded fallback tokens from scripts, package metadata, and internal utilities.
What's in the full analysis
OXSecurity's full analysis covers the operational detail this post intentionally leaves for the source:
- Step-by-step tracing of the malicious npm package’s post-install behaviour and GitHub API use
- Repository artifacts, commit timing, and exfiltration observations that support incident reconstruction
- Immediate response actions for anyone who may have installed the package, including token revocation and file checks
- The threat actor’s infrastructure and testing pattern before the package was taken down
👉 Read OXSecurity's analysis of the malicious npm infostealer and exposed GitHub token →
npm infostealer malware and exposed tokens: what did OXSecurity find?
Explore further
Exposed developer tokens are now a software supply chain problem, not just a secrets hygiene issue. The package did not need sophisticated exploitation once a usable GitHub token was available. It converted ordinary package installation into authenticated data theft, which means token scope, token storage, and revocation speed are now part of software supply chain governance. Practitioners should treat developer tokens as high-value NHIs that need lifecycle control, not informal convenience credentials.
A few things that frame the scale:
- 64% of valid secrets leaked in 2022 are still valid and exploitable today, proving that detection alone is not enough without automated revocation, according to The State of Secrets Sprawl 2026.
- AI-related credential leaks surged 81.5% year-over-year in 2025, with the surrounding AI infrastructure leaking 5x faster than core LLM providers.
A question worth separating out:
Q: Who is accountable when a compromised token is used to move across multiple systems?
A: Accountability usually spans identity owners, platform owners and security operations because the failure is distributed across issuance, scope, monitoring and revocation. In practice, frameworks such as Zero Trust and NHI governance require named ownership for each trust path, not just for the initial login event.
👉 Read our full editorial: Malicious npm infostealer exposed its own GitHub token