Malicious code in @stageflight-testbed/a (npm)
The npm package @stageflight-testbed/a contained malicious code that exfiltrates environment variables (including npm auth tokens) and executes arbitrary remote shell commands from a hardcoded C2 server. The payload is gated by an environment flag but remains reachable when set.
- Disclosed
- Last updated
- Blast radius
- Any npm consumer of @stageflight-testbed/a that executes the package with the __SF_TEST_NEVER__ environment variable set.
- Ecosystems
- Attack vectors
- Affected entities
- @stageflight-testbed/anpm package containing malicious code in index.ts
The npm package @stageflight-testbed/a was found to contain malicious code in its index.ts file. The code defines an exported _telemetry function that performs two primary malicious actions: (1) POSTs the full process.env object and NODE_AUTH_TOKEN to a remote endpoint, and (2) fetches and executes arbitrary shell code via curl from the same attacker-controlled server.
The C2 destination (http://185.220.101.47:8080/collect) is obfuscated using base64 encoding and decoded at runtime via Buffer.from(...,'base64') to evade static source code review. Execution is conditionally gated by the SF_TEST_NEVER environment variable, but the exfiltration and remote-execution code paths remain present and reachable whenever that flag is set by a caller.
This combination of full environment dump, npm authentication token theft, and remote code execution represents a critical supply-chain attack vector capable of compromising both the build environment and downstream systems. The attack was identified by the OpenSSF malicious-packages project.
Indicators of compromise
- Packages
- @stageflight-testbed/a
- IPs
- 185.220.101.47
Remediation
- Remove @stageflight-testbed/a from all package.json files and lock files
- Audit npm audit logs for any installations of @stageflight-testbed/a
- Rotate all npm authentication tokens and credentials that may have been exposed
- Review process environment variables and secrets that may have been exfiltrated to 185.220.101.47
- Scan build logs and CI/CD systems for evidence of execution with __SF_TEST_NEVER__ flag set
- Monitor outbound connections to 185.220.101.47 and related infrastructure
- Update to a patched version once available, or use an alternative package
Sources
- GitHub Advisory GHSA-26x7-qj39-p8cg · GitHub Advisory Database
Cite this entry
"Malicious code in @stageflight-testbed/a (npm)." supplychainattack.org, Supply Chain Attack Incident Catalog. Disclosed August 5, 2026; last updated August 5, 2026. https://supplychainattack.org/incident/malicious-code-in-stageflight-testbed-a-npm-1x2jxh
Suggest a correction
Found an error or have a newer source? Corrections to factual errors take priority over new entries.
Related incidents
- containedcritical
Malicious code in 3-buildsight-web (npm)
The npm package 3-buildsight-web contains malicious code that fetches and executes arbitrary JavaScript from a remote Bitbucket URL on module load, granting full page privileges to an unverified third party.
npmCompromised package - resolvedcritical
Malicious code in @usaa-grp-personal-profile/personal-profile-common (npm)
Malicious package @usaa-grp-personal-profile/personal-profile-common version 999.0.0 published to public npm as a dependency-confusion attack targeting an organization's internal registry. The package contains preinstall and postinstall hooks that exfiltrate hostname, username, and working directory to an attacker-controlled OAST endpoint on every install.
npmDependency confusionCompromised package - resolvedcritical
Malicious code in create-coin (npm)
create-coin@20.1.1 on npm contained malicious postinstall code that collected sensitive environment variables, credentials, and host reconnaissance data. The package impersonated an esbuild platform build and exfiltrated data to a hardcoded endpoint.
npmCompromised packageTyposquatting - resolvedcritical
Malicious code in @syncraft-labs/vue (npm)
The npm package @syncraft-labs/vue version 0.4.1 contained malicious obfuscated code in its ESM build that implements a blockchain-hosted C2 dropper (EtherHiding pattern), enabling remote code execution on any consumer importing the package.
npmCompromised package