Skip to main content

Malicious code in cors-update (npm)

0
Critical
Published: 08/05/2026 (08/05/2026, 09:10:11 UTC)
Source: GCVE Database
Product: cors-update

Description

The npm package 'cors-update' impersonates the legitimate 'cors' Express middleware but contains malicious code that fetches and executes attacker-controlled JavaScript code from a hardcoded URL. This execution occurs with full access to Node.js require, enabling arbitrary code execution in the host application. The malicious code disguises its network request as a blockchain RPC call and disables TLS verification, increasing risk. Applications that install and invoke this package as a substitute for 'cors' are vulnerable to remote code execution.

Affected software

npmghsa
cors-update
Affected versions
=2.8.4=1.0.0=2.8.3=1.0.1=2.8.0

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/05/2026, 15:41:30 UTC

Technical Analysis

The 'cors-update' npm package copies the legitimate 'expressjs/cors' source code but adds an exported 'getPlugin' factory function that performs an HTTPS GET request to a hardcoded attacker-controlled URL (https://api.avax-test.dev/ext/bc/rpc) with TLS verification disabled (rejectUnauthorized: false). The response body is passed to 'new Function' and executed with full 'require' access, allowing arbitrary JavaScript code execution within the consumer's Node.js process. Variable names in the code attempt to disguise the malicious request as a blockchain RPC call. The 'https' module is used without being imported at the top of the file, indicating obfuscation. Any application that installs this package as a replacement for the legitimate 'cors' middleware and invokes the exported factory is exposed to remote code execution.

Potential Impact

This vulnerability allows remote attackers to execute arbitrary code within the Node.js process of any application that installs and uses the 'cors-update' package as a substitute for the legitimate 'cors' middleware. The attacker-controlled code runs with full access to Node.js modules via 'require', potentially leading to complete system compromise, data theft, or further malicious activity. The disabling of TLS verification increases the risk of man-in-the-middle attacks during code fetch.

Mitigation Recommendations

No official patch or remediation is currently available for this malicious package. Users should immediately remove 'cors-update' from their dependencies and replace it with the legitimate 'cors' package from the official npm registry. Verify package authenticity before installation to avoid supply chain attacks. Monitor for any unexpected network activity related to the hardcoded URL and audit systems for signs of compromise if this package was used.

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

Threat ID: 6a735730bf8831d53913cdb3

Added to database: 08/05/2026, 15:30:56 UTC

Last enriched: 08/05/2026, 15:41:30 UTC

Last updated: 09/17/2026, 07:54:06 UTC

Views: 19

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