Skip to main content
MalwarePublished Updated

cookie-parser-legacy (npm) · Malicious Code

Affects cookie-parser-legacySource GCVE Database

0

Malicious package : remove cookie-parser-legacy and rotate any secrets on hosts that installed it.

Data as of 9 Jul 2026, 10:07 UTC

Classification

Malicious package

Published to npm · OSV MAL-2026-5346

What to do

Remove cookie-parser-legacy from every project, lockfile and image that pulls it in. Treat any host that installed it as compromised: rotate the credentials, tokens and keys it could read, from a clean machine.

Affected software

ProductAffectedFixed in
npmcookie-parser-legacyAffected
  • 1.5.1 – 1.5.4
4 affected builds
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

Description

The cookie-parser-legacy npm package impersonates the legitimate cookie-parser middleware but includes malicious code. It replaces a critical dependency with a malicious package pinned to a mutable 'latest' tag, allowing arbitrary code execution during installation. The package imports child_process execSync without legitimate use, indicating potential for executing arbitrary commands. Systems with this package installed should be considered fully compromised, and all secrets should be rotated. Removal of the package may not fully remediate the compromise.

References

Community reviews

Loading reviews…