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-25927

CVE-2022-25927: Ua-parser-js ReDoS Vulnerability

CVE-2022-25927 is a Regular Expression Denial of Service (ReDoS) flaw in ua-parser-js that can cause application slowdowns or crashes. This article covers the technical details, affected versions, and mitigation steps.

Published: February 17, 2026

CVE-2022-25927 Overview

CVE-2022-25927 is a Regular Expression Denial of Service (ReDoS) vulnerability affecting the popular ua-parser-js npm package. The vulnerability exists in the trim() function, which utilizes an inefficient regular expression pattern that can be exploited by attackers to cause catastrophic backtracking, resulting in application unavailability.

Critical Impact

Remote attackers can send specially crafted input to the trim() function, causing excessive CPU consumption and effectively rendering Node.js applications unresponsive.

Affected Products

  • ua-parser-js versions from 0.7.30 and before 0.7.33
  • ua-parser-js versions from 0.8.1 and before 1.0.33
  • Node.js applications using vulnerable ua-parser-js versions

Discovery Timeline

  • 2023-01-26 - CVE-2022-25927 published to NVD
  • 2025-04-01 - Last updated in NVD database

Technical Details for CVE-2022-25927

Vulnerability Analysis

This vulnerability stems from an unsafe regular expression pattern within the trim() function of the ua-parser-js library. Regular Expression Denial of Service (ReDoS) attacks exploit the exponential time complexity that certain regex patterns exhibit when processing specially crafted input strings. In this case, the vulnerable regex /\s\s*$/ used for trimming trailing whitespace contains a pattern that can lead to catastrophic backtracking when fed malicious input.

The ua-parser-js library is widely used for parsing User-Agent strings in web applications and Node.js servers. Due to its prevalence in the JavaScript ecosystem, this vulnerability has significant potential impact across numerous applications that process user-controlled User-Agent headers.

Root Cause

The root cause lies in the inefficient regular expression /\s\s*$/ used to trim trailing whitespace from strings. This pattern, combined with /^\s\s*/ for leading whitespace, creates a situation where the regex engine performs excessive backtracking operations when encountering certain input patterns. The fix removes the trailing whitespace regex entirely, eliminating the attack surface.

Attack Vector

The vulnerability is exploitable over the network without authentication. An attacker can craft malicious input strings that, when passed to the trim() function, trigger catastrophic backtracking in the regex engine. This can be accomplished by sending specially crafted User-Agent strings or other input that eventually reaches the vulnerable function, causing the Node.js event loop to block and the application to become unresponsive.

javascript
         },
         trim = function (str, len) {
             if (typeof(str) === STR_TYPE) {
-                str = str.replace(/^\s\s*/, EMPTY).replace(/\s\s*$/, EMPTY);
+                str = str.replace(/^\s\s*/, EMPTY);
                 return typeof(len) === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
             }
     };

Source: GitHub Security Patch

Detection Methods for CVE-2022-25927

Indicators of Compromise

  • Unusual CPU spikes in Node.js processes handling User-Agent parsing
  • Application timeouts or unresponsiveness when processing HTTP requests
  • Log entries showing excessively long request processing times for endpoints parsing User-Agent strings

Detection Strategies

  • Implement dependency scanning in CI/CD pipelines to identify vulnerable ua-parser-js versions (0.7.30 to 0.7.32 and 0.8.1 to 1.0.32)
  • Monitor application performance metrics for anomalous CPU utilization patterns
  • Use Software Composition Analysis (SCA) tools to audit npm dependencies for known vulnerabilities

Monitoring Recommendations

  • Enable application performance monitoring (APM) to detect latency anomalies in request processing
  • Configure alerting for Node.js event loop lag exceeding normal thresholds
  • Implement request timeout policies to prevent long-running regex operations from blocking the event loop

How to Mitigate CVE-2022-25927

Immediate Actions Required

  • Update ua-parser-js to version 0.7.33 or later for the 0.7.x branch
  • Update ua-parser-js to version 1.0.33 or later for the 0.8.x/1.0.x branch
  • Audit all applications and dependencies that include ua-parser-js as a transitive dependency
  • Run npm audit or yarn audit to identify vulnerable packages in your dependency tree

Patch Information

The vulnerability has been patched in ua-parser-js versions 0.7.33 and 1.0.33. The fix removes the vulnerable trailing whitespace regex pattern from the trim() function. The security patch is available via the official GitHub commit. Additional technical details can be found in the Snyk Vulnerability Report.

Workarounds

  • Implement request timeout middleware to prevent long-running operations from blocking application responsiveness
  • Apply rate limiting on endpoints that process User-Agent strings to reduce attack surface
  • Consider input length validation before passing strings to the ua-parser-js library
bash
# Update ua-parser-js to patched version
npm update ua-parser-js

# Or install specific patched versions
npm install ua-parser-js@0.7.33  # For 0.7.x branch
npm install ua-parser-js@1.0.33  # For 1.0.x branch

# Verify no vulnerable versions remain
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/TechUa Parser Js

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability1.75%

  • 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
  • Snyk Vulnerability Report
  • Vendor Resources
  • GitHub Commit Update
  • Latest CVEs
  • CVE-2025-52793: Esselink.nu Settings CSRF Vulnerability

  • CVE-2025-52772: Virtual Moderator CSRF Vulnerability

  • CVE-2025-48279: WC MyParcel Belgium XSS Vulnerability

  • CVE-2025-39381: KiotViet Sync 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