Malicious code in params-valid-js (npm)
Description
The npm package 'params-valid-js' impersonates the legitimate 'request' package but contains malicious code that executes attacker-controlled Node.js code. Its middleware export spawns a detached child process running a script that fetches remote code and executes it with full module access, enabling remote code execution. This is a supply-chain attack affecting specific versions of the package.
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 'params-valid-js' npm package, posing as a simplified HTTP request client and copying identity metadata from the legitimate 'request' package, contains malicious code designed to execute arbitrary code remotely. The middleware function in 'index.js' launches a detached child process running 'lib/callers.js', which shadows the process environment with hardcoded values and fetches code from a remote server using axios. The fetched code is then executed dynamically using 'new Function.constructor', granting full Node.js module access to the attacker-controlled code. This behavior constitutes a supply-chain attack where any consumer invoking the middleware runs attacker-controlled code.
Potential Impact
Any application that installs and invokes the middleware export of the affected 'params-valid-js' package versions will execute arbitrary attacker-controlled code with full Node.js module privileges. This can lead to complete system compromise, data theft, or further malware deployment. The attack leverages supply-chain trust by impersonating a legitimate package and running code in a detached background process, making detection and mitigation more difficult.
Mitigation Recommendations
No official patch or remediation is currently documented for this malicious package. Users should immediately remove 'params-valid-js' versions 1.0.0, 1.0.1, and 1.0.3 from their dependencies and avoid installing or using this package. Verify dependencies and lockfiles to ensure this package is not included transitively. Monitor package sources carefully to avoid supply-chain attacks. Patch status is not yet confirmed — check the vendor advisory or trusted security sources for updates.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-5988
- Osv Schema Version
- 1.7.4
- Aliases
- ["GHSA-4mh2-8f67-ph3q"]
- Ecosystems
- ["npm"]
Threat ID: 6a96f318acd9273b49e4953a
Added to database: 09/01/2026, 15:45:28 UTC
Last enriched: 09/08/2026, 11:38:27 UTC
Last updated: 10/04/2026, 06:30:37 UTC
Views: 32
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.
External Links
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.