Skip to main content

Malicious code in express-mocha-test (npm)

0
Critical
Published: 06/29/2026 (06/29/2026, 04:25:49 UTC)
Source: GCVE Database
Product: express-mocha-test

Description

The npm package express-mocha-test version 0.0.1 contains malicious code that executes attacker-controlled JavaScript during installation. It uses a postinstall lifecycle hook to fetch code from an attacker-controlled ngrok-free.app tunnel and evaluates it directly, leading to remote code execution on any machine running npm install for this package. The package metadata impersonates known maintainers to deceive users. This results in full system compromise, requiring immediate secret and key rotation and package removal.

Affected software

npmghsa
express-mocha-test
Affected versions
=0.0.1

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:38 UTC

Technical Analysis

The express-mocha-test package at version 0.0.1 declares a postinstall lifecycle hook that loads its main module, which performs a fetch request to an anonymous, attacker-controlled ngrok-free.app tunnel. The response body from this request is passed directly to eval(), executing arbitrary JavaScript controlled by the attacker on any system that installs the package. The package metadata falsely claims authorship by a well-known maintainer and misrepresents its functionality, indicating deliberate impersonation. This behavior results in complete compromise of affected systems, as attacker code runs with the privileges of the installing user.

Potential Impact

Any system that installs [email protected] is subject to remote code execution by attacker-controlled code fetched during installation. This leads to full system compromise, including potential theft or manipulation of secrets and keys stored on the machine. The compromise is severe enough that simply removing the package does not guarantee removal of all malicious artifacts, necessitating secret rotation and thorough system remediation.

Defensive Guidance

Remove the express-mocha-test package immediately from all affected systems. Rotate all secrets and keys that were stored or accessible on compromised machines from a secure, unaffected environment. Due to the nature of the compromise, assume full system compromise and perform comprehensive incident response and system remediation. No official patch or fix is available for this malicious package; avoid installing or using this package altogether.

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-6568
Osv Schema Version
1.7.4
Ecosystems
["npm"]

Threat ID: 6a42ed6d27e9c79719938e97

Added to database: 06/29/2026, 22:10:53 UTC

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

Last updated: 09/07/2026, 20:42:02 UTC

Views: 54

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