Malicious code in test-pkg-yarn (npm)
The npm package 'test-pkg-yarn' versions 1.0.0, 1.0.1, and 1.0.2 contains malicious code that hijacks the 'node' command by symlinking it to a package-controlled script. This script executes arbitrary OS commands at install time, including launching calculator applications, opening a URL in the user's browser, and writing a marker file. The package displays a console message indicating the PATH has been poisoned. Although presented as a proof-of-concept, this behavior results in real code execution during installation and persistent command hijacking.
AI Analysis
Technical Summary
The 'test-pkg-yarn' npm package declares a 'bin' entry that causes npm/yarn to symlink the 'node' command to a malicious script 'shim.js'. This hijack causes any invocation of 'node' resolved through the PATH to execute attacker-controlled code instead of the legitimate Node.js runtime. During installation, the package runs 'shim.js' via postinstall scripts, which executes OS commands unconditionally, including spawning calculator applications on Windows, Linux, and macOS, opening a URL in the user's browser, and creating a marker file in '/tmp'. The package self-identifies as a proof-of-concept named 'BunnyHijack PoC - yarn variant' and warns users of the PATH poisoning. While no data exfiltration is currently observed, the package compromises the developer environment by enabling arbitrary code execution and persistent command hijacking.
Potential Impact
Any system that installs this package is subject to arbitrary code execution at install time and persistent hijacking of the 'node' command, which can lead to full system compromise. The package's behavior includes spawning OS processes and modifying the environment to redirect 'node' invocations to malicious code. According to the source, any computer with this package installed should be considered fully compromised, and all secrets and keys stored on that computer should be rotated immediately from a different machine. Removing the package does not guarantee removal of all malicious artifacts or backdoors.
Mitigation Recommendations
No official patch or fix is currently available for this package. The recommended mitigation is to avoid installing 'test-pkg-yarn' versions 1.0.0, 1.0.1, and 1.0.2. If already installed, remove the package and consider the system fully compromised. Rotate all secrets and keys from a separate, trusted environment. Monitor for any unauthorized changes or persistence mechanisms introduced by the package. Exercise caution when installing packages from untrusted sources, especially those that override common commands.
Malicious code in test-pkg-yarn (npm)
Description
The npm package 'test-pkg-yarn' versions 1.0.0, 1.0.1, and 1.0.2 contains malicious code that hijacks the 'node' command by symlinking it to a package-controlled script. This script executes arbitrary OS commands at install time, including launching calculator applications, opening a URL in the user's browser, and writing a marker file. The package displays a console message indicating the PATH has been poisoned. Although presented as a proof-of-concept, this behavior results in real code execution during installation and persistent command hijacking.
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-yarn' npm package declares a 'bin' entry that causes npm/yarn to symlink the 'node' command to a malicious script 'shim.js'. This hijack causes any invocation of 'node' resolved through the PATH to execute attacker-controlled code instead of the legitimate Node.js runtime. During installation, the package runs 'shim.js' via postinstall scripts, which executes OS commands unconditionally, including spawning calculator applications on Windows, Linux, and macOS, opening a URL in the user's browser, and creating a marker file in '/tmp'. The package self-identifies as a proof-of-concept named 'BunnyHijack PoC - yarn variant' and warns users of the PATH poisoning. While no data exfiltration is currently observed, the package compromises the developer environment by enabling arbitrary code execution and persistent command hijacking.
Potential Impact
Any system that installs this package is subject to arbitrary code execution at install time and persistent hijacking of the 'node' command, which can lead to full system compromise. The package's behavior includes spawning OS processes and modifying the environment to redirect 'node' invocations to malicious code. According to the source, any computer with this package installed should be considered fully compromised, and all secrets and keys stored on that computer should be rotated immediately from a different machine. Removing the package does not guarantee removal of all malicious artifacts or backdoors.
Defensive Guidance
No official patch or fix is currently available for this package. The recommended mitigation is to avoid installing 'test-pkg-yarn' versions 1.0.0, 1.0.1, and 1.0.2. If already installed, remove the package and consider the system fully compromised. Rotate all secrets and keys from a separate, trusted environment. Monitor for any unauthorized changes or persistence mechanisms introduced by the package. Exercise caution when installing packages from untrusted sources, especially those that override common commands.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-6718
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-r653-6655-p467"]
- Ecosystems
- ["npm"]
- Database Specific Severity
- null
- Cvss Version
- null
Threat ID: 6a870a77acd9273b49b593ae
Added to database: 08/20/2026, 14:08:55 UTC
Last enriched: 08/20/2026, 14:35:53 UTC
Last updated: 08/20/2026, 23:35:52 UTC
Views: 7
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.