Skip to main content

Malicious code in evil-pkg (npm)

0
High
Published: 06/24/2026 (06/24/2026, 06:16:56 UTC)
Source: GCVE Database
Product: evil-pkg

Description

The npm package 'evil-pkg' versions 1.0.0 through 1.0.5 contains malicious code that hijacks the 'node' command by registering a shim script in the local bin directory. This shim executes during package installation, allowing unconsented code execution with the installer's privileges. The current payload is benign but demonstrates a supply-chain attack vector capable of exfiltrating sensitive files. Any system with this package installed should be considered compromised, and secrets should be rotated immediately.

Affected software

npmghsa
evil-pkg
Affected versions
=1.0.0=1.0.1=1.0.5=1.0.4=1.0.2=1.0.3

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

AILast updated: 08/20/2026, 16:57:52 UTC

Technical Analysis

The 'evil-pkg' npm package declares a 'bin' entry that registers a shim script named 'node' in 'node_modules/.bin'. When this directory is prepended to the PATH, any invocation of 'node' during package installation runs the shim instead of the legitimate Node.js runtime. The shim writes a marker file and prints a hijack banner, demonstrating a fully functional code execution channel. This mechanism enables an attacker to run arbitrary code with the installer's privileges during installation lifecycle scripts. The package README explicitly markets this as a proof-of-concept for PATH-poisoning attacks and notes that real attackers could exfiltrate sensitive files like '.env', '~/.ssh', and '~/.npmrc'. This behavior constitutes a deliberate supply-chain attack vector. Versions 1.0.0 through 1.0.5 are affected.

Potential Impact

Systems that install 'evil-pkg' versions 1.0.0 through 1.0.5 are at risk of unconsented code execution during package installation. This can lead to full system compromise, including unauthorized access to sensitive files and credentials. The attack vector hijacks the core 'node' runtime command, potentially affecting other packages and scripts during installation. Because the malicious code runs with the installer's privileges, attackers can gain extensive control over the affected system. Removal of the package alone may not fully remediate the compromise, and all secrets should be rotated from a secure environment.

Mitigation Recommendations

No official patch or fix is indicated in the provided data. Users should immediately remove 'evil-pkg' versions 1.0.0 through 1.0.5 from their environments. Given the potential full compromise, all secrets and keys stored on affected systems should be rotated from a different, trusted machine. Monitor for suspicious activity related to package installations and avoid using this package. Since the package is malicious by design, do not trust any code or binaries installed alongside it. Patch status is not yet confirmed — check the vendor advisory or npm registry for updates.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
MAL-2026-6374
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a520eb968715ace438f5683

Added to database: 07/11/2026, 09:36:57 UTC

Last enriched: 08/20/2026, 16:57:52 UTC

Last updated: 09/11/2026, 21:29:38 UTC

Views: 43

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses