Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2022-25901

CVE-2022-25901: Cookiejar ReDoS Vulnerability Explained

CVE-2022-25901 is a Regular Expression Denial of Service (ReDoS) vulnerability in Cookiejar that exploits the Cookie.parse function. This article covers the technical details, affected versions, and mitigation strategies.

Published: February 17, 2026

CVE-2022-25901 Overview

CVE-2022-25901 is a Regular Expression Denial of Service (ReDoS) vulnerability affecting versions of the cookiejar package before 2.1.4. The vulnerability exists in the Cookie.parse function, which uses an insecure regular expression that can be exploited to cause excessive CPU consumption, leading to denial of service conditions in applications that depend on this package.

Critical Impact

Applications using vulnerable versions of cookiejar can be rendered unresponsive through crafted input that triggers catastrophic backtracking in the regular expression engine, causing CPU exhaustion and service unavailability.

Affected Products

  • cookiejar_project cookiejar (versions before 2.1.4)
  • Node.js applications using vulnerable cookiejar versions
  • Java applications using cookiejar via WebJars

Discovery Timeline

  • 2023-01-18 - CVE-2022-25901 published to NVD
  • 2025-02-13 - Last updated in NVD database

Technical Details for CVE-2022-25901

Vulnerability Analysis

This vulnerability is classified under CWE-1333 (Inefficient Regular Expression Complexity). The cookiejar package, a popular Node.js library for managing HTTP cookies, contains a flawed regular expression pattern in its Cookie.parse function. When processing specially crafted cookie strings, the regular expression exhibits catastrophic backtracking behavior—a well-known weakness in regex engines where certain input patterns cause exponential time complexity.

The vulnerability can be exploited remotely without requiring authentication or user interaction. An attacker can send malicious cookie values to any application endpoint that processes cookies using the vulnerable cookiejar library, causing the application to become unresponsive as the CPU becomes consumed by the regex evaluation.

Root Cause

The root cause of this vulnerability lies in the inefficient regular expression pattern used within the Cookie.parse function located in cookiejar.js. The regex contains quantifiers and alternation patterns that, when combined with specific input strings, trigger exponential backtracking. This occurs because the regex engine must explore an exponentially growing number of possible matching paths before determining a final result.

ReDoS vulnerabilities typically arise from regex patterns containing:

  • Nested quantifiers (e.g., (a+)+)
  • Overlapping alternations with quantifiers
  • Greedy quantifiers without proper anchoring

The fix implemented in version 2.1.4 addresses this by optimizing the regular expression to prevent catastrophic backtracking scenarios.

Attack Vector

The attack can be executed remotely over the network. An attacker crafts a malicious cookie string designed to maximize backtracking in the vulnerable regular expression. This string is then sent as part of an HTTP request to an application using the vulnerable cookiejar package. When the application attempts to parse the cookie using Cookie.parse, the regex engine enters an extended computation state, consuming CPU resources and blocking the event loop in Node.js applications.

Since this is a denial of service attack, the primary impact is on availability. No authentication is required, and no user interaction is needed—making it straightforward to exploit against publicly accessible applications.

For technical details on the vulnerable code pattern, refer to the GitHub Cookie Jar Source Code and the Snyk JS Vulnerability Report.

Detection Methods for CVE-2022-25901

Indicators of Compromise

  • Unusual CPU spikes on application servers processing HTTP requests
  • Application timeouts or unresponsiveness during cookie parsing operations
  • Increased request latency or timeout errors in monitoring dashboards
  • Event loop blocking in Node.js applications with high event loop lag metrics

Detection Strategies

  • Implement dependency scanning using tools like npm audit, Snyk, or OWASP Dependency-Check to identify vulnerable cookiejar versions
  • Monitor application performance metrics for abnormal CPU utilization patterns
  • Use Software Composition Analysis (SCA) tools in CI/CD pipelines to detect vulnerable dependencies before deployment
  • Review application logs for patterns indicating slow request processing related to cookie handling

Monitoring Recommendations

  • Configure alerting for CPU utilization thresholds on servers running applications with cookiejar dependencies
  • Implement request timeout monitoring to detect requests that hang during processing
  • Enable Node.js event loop monitoring to identify blocking operations
  • Set up dependency vulnerability alerts through package management tools or security platforms

How to Mitigate CVE-2022-25901

Immediate Actions Required

  • Upgrade cookiejar to version 2.1.4 or later immediately
  • Audit all projects and dependencies that may include cookiejar as a transitive dependency
  • Run npm audit or equivalent dependency scanning to identify affected applications
  • Implement rate limiting on endpoints that process cookies to reduce exploitation impact

Patch Information

The vulnerability has been addressed in cookiejar version 2.1.4. The fix optimizes the regular expression in the Cookie.parse function to eliminate the catastrophic backtracking condition. The patch is available through the GitHub Pull Request #39 with the specific fix implemented in commit eaa0002.

For Debian-based systems, refer to the Debian LTS Security Announcement for distribution-specific patch information.

Workarounds

  • Implement input validation and length restrictions on cookie values before they reach the cookiejar parsing function
  • Add request timeout configurations to limit the impact of ReDoS attacks on application availability
  • Consider using alternative cookie parsing libraries that have been audited for ReDoS vulnerabilities
  • Deploy Web Application Firewalls (WAF) with rules to detect and block abnormally long or malformed cookie values
bash
# Upgrade cookiejar to patched version
npm update cookiejar

# Verify installed version is 2.1.4 or later
npm list cookiejar

# Run security audit to check for other vulnerabilities
npm audit

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechCookiejar Project

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.07%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-1333
  • Technical References
  • GitHub Cookie Jar Source Code

  • Debian LTS Security Announcement

  • Snyk Java Vulnerability SNYK-JAVA-ORGWEBJARSNPM-3176681

  • Snyk JS Vulnerability SNYK-JS-COOKIEJAR-3149984
  • Vendor Resources
  • GitHub Pull Request #39

  • GitHub Commit eaa0002
  • Latest CVEs
  • CVE-2026-40322: SiYuan Knowledge Management RCE Vulnerability

  • CVE-2026-40318: SiYuan Path Traversal Vulnerability

  • CVE-2026-40259: SiYuan Auth Bypass Vulnerability

  • CVE-2026-40255: AdonisJS HTTP Server CSRF Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English