Malicious code in cors-update (npm)
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.
AI Analysis
Technical Summary
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.
Malicious code in cors-update (npm)
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
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 '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.
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 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.