Malicious Code Vulnerability in cookie-validate Package

cookie-validate Updated 02 Dec 2025

Summary

01/12/2025
CRITICAL
No i
Critical
Not published

MAL-2025-191569: Malicious code in cookie-validate (npm). Affects cookie-validate versions 2.2.4. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The cookie-validate package is an npm library designed to validate cookie values in web applications, ensuring that they conform to expected formats and security standards. It is widely used in Node.js applications to enhance security by preventing cookie-related vulnerabilities. However, the package has recently been compromised, leading to the introduction of malicious code that could potentially harm applications using it.

Vulnerability Detail

The vulnerability identified in the cookie-validate package stems from the introduction of malicious code in version 2.2.4. This code could allow attackers to execute arbitrary commands or access sensitive data, posing significant risks to applications that rely on this package. The malicious code was discovered through a security audit and is linked to a specific commit in the package's repository, indicating that it was intentionally introduced.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall cookie-validate

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If immediate updating is not feasible, consider removing the cookie-validate package temporarily and replacing it with an alternative validation library until a secure version is available. You can also implement custom cookie validation logic to mitigate risks.

Conclusion

The cookie-validate package has been compromised, leading to a significant vulnerability that could affect applications using it. It is essential to update to the latest version to mitigate risks. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for cookie-validate →

Share this vulnerability

FAQ

cookie-validate is an npm library used for validating cookie values in web applications, ensuring they meet security standards.

The malicious code was introduced in version 2.2.4 of the cookie-validate package, likely through a compromised commit.

The risks include potential unauthorized access to sensitive data and the ability for attackers to execute arbitrary commands within the application.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.

Consider removing the cookie-validate package temporarily and using an alternative validation library or implementing custom cookie validation logic.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall cookie-validate

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback