Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
Malicious package

cookie-parser-legacynpm

Malicious code in cookie-parser-legacy (npm) Remove it immediately and rotate any exposed credentials.

MAL-2026-5346
Immediate action
Remove the package, then rotate any secrets the build/runtime could reach.
npm uninstall cookie-parser-legacy

What this malware does

Package name and README impersonate the well-known cookie-parser Express middleware. The source is a near-verbatim copy of cookie-parser, except the legitimate cookie-signature dependency has been replaced with an unknown package moustick pinned to the mutable latest tag (package.json: "moustick": "latest"). index.js requires moustick as signature and invokes signature.unsign(str.slice(2), secrets[i]) at request time on user-supplied cookie values, executing whatever code moustick currently publishes against installer-side cookie secrets and signed values. index.js additionally imports execSync from child_process at the top of the file with no reference anywhere in the cookie-parsing logic — an unusual staging artifact for a pure parsing module. The combination of name-impersonation of a top-tier middleware, silent substitution of a security-critical dependency, and pinning that substitute to a mutable tag means any installer who picks this up thinking it is cookie-parser will resolve and execute arbitrary third-party code controlled by the moustick publisher on every install.

Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.

Malicious versions

4 flagged
1.5.11.5.21.5.31.5.4

Indicators of compromise (SHA-256)

1b0e373057d636dbc4939fdb3e1f8cda1276c8bb88ae02f5ed156244e12fdb91
53a673e0454bb102d4e8456e3c26290196c5ae5bf4cf9438ce78f8286fd5c3be
865049d4fed50032d3c36e8e758ffa9177d0ae0e9e90b9e09096c50f3c660e6e
5c6f43b710662318a9b7b583c0a4d809ff987ee524be02193b5ce47e88fcfb38
5def09fe1321d0d0ca7e8e718dc95499b9678bf93a9a084d03afdae4e7839ded

Detection & response playbook

Typosquat
  1. Find it

    Scan your lockfiles (package-lock.json, pnpm-lock.yaml, yarn.lock, requirements.txt, poetry.lock, etc.) and build artifacts for cookie-parser-legacy (4 malicious versions). O3 Security's supply-chain scanner checks every dependency against known-malicious package intelligence at install time and in CI, flagging cookie-parser-legacy across your stack and pipelines.

  2. If you installed it — respond

    cookie-parser-legacy is a typosquat — you almost certainly intended a legitimately-named package. Remove cookie-parser-legacy, install the correct package, and rotate any secrets exposed during the install since post-install scripts may have already run.

  3. Did it already run?

    If cookie-parser-legacy was ever installed, its post-install/runtime payload may have already executed. O3's L7 egress monitoring and runtime eBPF sensors detect the credential exfiltration or command-and-control callback after install and block the malicious outbound channel, so you catch and contain the actual compromise — not just the presence of the package.

  4. How O3 protects you

    O3 blocks cookie-parser-legacy before install through its supply-chain scanner, and if it has already run, detects and severs the exfiltration or C2 callback at runtime through L7 egress monitoring and eBPF.

Frequently asked questions

No. cookie-parser-legacy on npm has been identified as a malicious package (versions 1.5.1, 1.5.2, 1.5.3, 1.5.4 flagged). It should be removed immediately — do not install or keep it in your dependency tree.

Campaign

GHSA-xv3p-wcmf-6hp8IN-MAL-2026-005845IN-MAL-2026-005844IN-MAL-2026-008800IN-MAL-2026-008804

References

Credits

  • Amazon Inspector · finder

Detect & block this

O3 blocks cookie-parser-legacy-class packages before install and in CI — and if it already ran, its runtime egress monitoring catches the malicious outbound activity and severs the channel.

cookie-parser-legacy (npm) malicious package — MAL-2026-5346 | O3 Security