Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Malicious code in express-guardian (npm)

0
Critical
Published: 07/10/2026 (07/10/2026, 22:42:45 UTC)
Source: GCVE Database
Product: express-guardian

Description

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (2c911dfdf99f0c6e13cb9e55883a5c2e17cca0b78d3149e38c0cafb6320ea742) The package advertises itself as Express security middleware (XSS/SQLi protection, input sanitization) but the middleware returned to Express is a no-op that only calls next(). The real behavior is triggered when the exported expressSecurity() is invoked (e.g. via the README-recommended `app.use(expressSecurity())`): index.js spawns a detached `node lib/caller.js` child process (stdio ignored, detached=true so it survives the parent). caller.js fetches a hardcoded plain-HTTP endpoint at http://server-genimi-check.vercel.app/defy/v3 and, on a 404 response, passes the response body's `token` field to `new (Function.constructor)("require", res.token)` and invokes it with the real `require` bound — executing attacker-supplied JavaScript in the installer's Node process with full module access. A secondary payload URL is base64-hidden in lib/const.js (DEV_API_KEY decodes to https://jsonkeeper.com/b/4NAKK, a public paste service used as a mutable config/C2 channel). The security-middleware name, README, and no-op middleware shim are cover for the remote code loader; the plain-HTTP transport and paste-hosted secondary channel let the operator swap the executed payload at any time without republishing.

Affected software

npmghsa
express-guardian
Affected versions
=1.4.1=1.4.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: 07/11/2026, 09:45:26 UTC

Technical Analysis

The express-guardian npm package (versions 1.4.1 and 1.4.3) advertises itself as security middleware for Express.js but implements a no-op middleware that only calls next(). The actual malicious behavior occurs when the exported expressSecurity() function is invoked, spawning a detached Node.js child process that fetches JavaScript code from a hardcoded plain-HTTP URL (http://server-genimi-check.vercel.app/defy/v3). Upon receiving a 404 response, it extracts a token from the response body and dynamically constructs and executes a function with full access to Node.js modules, effectively executing attacker-controlled code remotely. Additionally, a secondary payload URL is base64-encoded in the package and points to a public paste service, allowing the attacker to update the malicious payload dynamically without republishing the package. This design enables persistent remote code execution on any system that installs and uses this package as recommended.

Potential Impact

This malicious package enables remote code execution within the Node.js process of any application that installs and uses express-guardian versions 1.4.1 or 1.4.3 as recommended. The attacker can execute arbitrary JavaScript code with full module access, potentially leading to full system compromise, data theft, or further malware deployment. The use of a mutable external payload URL allows the attacker to change the malicious code at will without republishing the package, increasing the threat's persistence and flexibility.

Mitigation Recommendations

No official patch or fix is currently available for this malicious package. The recommended mitigation is to avoid using express-guardian versions 1.4.1 and 1.4.3 entirely. Remove these versions from your projects and replace them with trusted, verified security middleware alternatives. Monitor your environment for any signs of compromise if this package was previously installed and used. Since this is a malicious package, do not attempt to use or trust any code from it.

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-10182
Osv Schema Version
1.7.4
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
null
Cvss Version
null

Threat ID: 6a520ea768715ace438f4423

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

Last enriched: 07/11/2026, 09:45:26 UTC

Last updated: 07/26/2026, 09:35:30 UTC

Views: 31

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