Malicious code in test-pkg-x0 (npm)
The npm package 'test-pkg-x0' contains malicious code that executes arbitrary commands on the installer's machine during installation. It uses a postinstall script 'shim.js' that runs unconditionally and executes OS-native commands, including launching applications and opening URLs. The package also hijacks the 'node' command for sibling dependencies, enabling further arbitrary code execution during dependency installation. This behavior fully compromises any system installing the package, risking exposure of all stored secrets and keys.
AI Analysis
Technical Summary
The 'test-pkg-x0' npm package declares a postinstall script 'shim.js' that executes unconditionally on npm install. This script branches based on the operating system and runs native commands such as launching the Calculator app and opening a GitHub URL in the default browser as proof-of-concept payloads. Additionally, the package.json registers a 'bin' entry named 'node' mapped to 'shim.js', which hijacks the 'node' command in environments like the bun package manager. This hijacking causes any dependency postinstall script invoking 'node' to execute the malicious shim instead of the legitimate Node.js runtime. The combined effect allows fully attacker-controlled arbitrary command execution on the installer's machine during installation and dependency resolution. The package versions 1.0.0 through 1.0.4 are affected.
Potential Impact
Any system installing 'test-pkg-x0' versions 1.0.0 to 1.0.4 is fully compromised due to arbitrary command execution during installation. This includes direct execution via the package's own postinstall script and indirect execution by hijacking the 'node' command used by sibling dependencies. Attackers can execute any commands with the installer's privileges, potentially leading to full system compromise and exposure of all secrets and keys stored on the machine. Removal of the package does not guarantee elimination of all malicious artifacts or backdoors introduced.
Mitigation Recommendations
No official patch or fix is currently documented. Users should immediately remove the 'test-pkg-x0' package from their systems if installed. All secrets and keys stored on affected machines should be considered compromised and rotated from a secure, unaffected environment. Due to the full compromise risk, affected systems should be thoroughly audited and potentially rebuilt. Monitor vendor advisories for any future remediation updates.
Malicious code in test-pkg-x0 (npm)
Description
The npm package 'test-pkg-x0' contains malicious code that executes arbitrary commands on the installer's machine during installation. It uses a postinstall script 'shim.js' that runs unconditionally and executes OS-native commands, including launching applications and opening URLs. The package also hijacks the 'node' command for sibling dependencies, enabling further arbitrary code execution during dependency installation. This behavior fully compromises any system installing the package, risking exposure of all stored secrets and keys.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The 'test-pkg-x0' npm package declares a postinstall script 'shim.js' that executes unconditionally on npm install. This script branches based on the operating system and runs native commands such as launching the Calculator app and opening a GitHub URL in the default browser as proof-of-concept payloads. Additionally, the package.json registers a 'bin' entry named 'node' mapped to 'shim.js', which hijacks the 'node' command in environments like the bun package manager. This hijacking causes any dependency postinstall script invoking 'node' to execute the malicious shim instead of the legitimate Node.js runtime. The combined effect allows fully attacker-controlled arbitrary command execution on the installer's machine during installation and dependency resolution. The package versions 1.0.0 through 1.0.4 are affected.
Potential Impact
Any system installing 'test-pkg-x0' versions 1.0.0 to 1.0.4 is fully compromised due to arbitrary command execution during installation. This includes direct execution via the package's own postinstall script and indirect execution by hijacking the 'node' command used by sibling dependencies. Attackers can execute any commands with the installer's privileges, potentially leading to full system compromise and exposure of all secrets and keys stored on the machine. Removal of the package does not guarantee elimination of all malicious artifacts or backdoors introduced.
Mitigation Recommendations
No official patch or fix is currently documented. Users should immediately remove the 'test-pkg-x0' package from their systems if installed. All secrets and keys stored on affected machines should be considered compromised and rotated from a secure, unaffected environment. Due to the full compromise risk, affected systems should be thoroughly audited and potentially rebuilt. Monitor vendor advisories for any future remediation updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-6717
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-45jm-p8g6-hcxf"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a870a77acd9273b49b593b0
Added to database: 08/20/2026, 14:08:55 UTC
Last enriched: 08/20/2026, 14:36:14 UTC
Last updated: 08/20/2026, 22:27:10 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.