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

CVE-2022-25883: Npmjs Semver ReDoS Vulnerability

CVE-2022-25883 is a Regular Expression Denial of Service flaw in Npmjs Semver that allows attackers to cause service disruption through malicious input. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2022-25883 Overview

CVE-2022-25883 is a Regular Expression Denial of Service (ReDoS) vulnerability affecting versions of the semver package before 7.5.2. The vulnerability exists in the new Range function, which can be exploited when untrusted user data is provided as a range parameter. This allows attackers to cause excessive CPU consumption by providing specially crafted input strings that trigger catastrophic backtracking in the regex engine.

Critical Impact

Applications using vulnerable versions of the semver package to parse user-supplied version range strings are susceptible to denial of service attacks, potentially causing service unavailability and resource exhaustion.

Affected Products

  • npmjs semver versions prior to 7.5.2
  • Node.js applications using vulnerable semver versions
  • Development tools and CI/CD pipelines with semver dependencies

Discovery Timeline

  • 2023-06-21 - CVE CVE-2022-25883 published to NVD
  • 2025-09-23 - Last updated in NVD database

Technical Details for CVE-2022-25883

Vulnerability Analysis

This vulnerability is classified under CWE-1333 (Inefficient Regular Expression Complexity). The semver package is a widely-used Node.js library for parsing and comparing semantic version strings. The vulnerability resides in the Range class, specifically in how whitespace is processed within version range strings.

The root issue stems from regex patterns in the re.js file that exhibit polynomial time complexity when processing certain inputs. When an attacker provides a maliciously crafted range string with excessive whitespace or specific character patterns, the regex engine enters catastrophic backtracking, consuming significant CPU resources and potentially blocking the event loop.

Root Cause

The vulnerability originates from inefficient regular expression patterns used to parse version range strings. Prior to the fix, the Range class relied on complex regex patterns involving \s* (zero or more whitespace) that could be exploited through carefully constructed input strings. These patterns, when combined with specific input, cause the regex engine to evaluate an exponentially growing number of possible matches.

Attack Vector

The attack is network-exploitable and requires no authentication. An attacker can trigger the vulnerability by:

  1. Identifying an application endpoint that accepts version range input processed by the vulnerable semver library
  2. Crafting a malicious input string designed to trigger catastrophic regex backtracking
  3. Submitting the payload, causing the target application's CPU to spike and potentially become unresponsive

The fix normalizes whitespace before processing, reducing reliance on potentially slow regex patterns:

javascript
// Security patch in classes/comparator.js
    }
  }

+    comp = comp.trim().split(/\s+/).join(' ')
  debug('comparator', comp, options)
  this.options = options
  this.loose = !!options.loose

Source: GitHub Commit 717534ee

The Range class was also patched to preprocess whitespace:

javascript
// Security patch in classes/range.js
  this.loose = !!options.loose
  this.includePrerelease = !!options.includePrerelease

-    // First, split based on boolean or ||
+    // First reduce all whitespace as much as possible so we do not have to rely
+    // on potentially slow regexes like \s*. This is then stored and used for
+    // future error messages as well.
  this.raw = range
-    this.set = range
+      .trim()
+      .split(/\s+/)
+      .join(' ')
+
+    // First, split on ||
+    this.set = this.raw
    .split('||')
    // map the range to a 2d array of comparators
-      .map(r => this.parseRange(r.trim()))
+      .map(r => this.parseRange(r))
    // throw out any comparator lists that are empty
    // this generally means that it was not a valid range, which is allowed
    // in loose mode, but will still throw if the WHOLE range is invalid.
    .filter(c => c.length)

  if (!this.set.length) {
-      throw new TypeError(`Invalid SemVer Range: ${range}`)
+      throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
  }

  // if we have any that are not the null set, throw out null sets.

Source: GitHub Commit 717534ee

Detection Methods for CVE-2022-25883

Indicators of Compromise

  • Unusual CPU spikes on application servers processing version strings
  • Slow response times or timeouts on endpoints accepting version range input
  • Node.js event loop blocking or application hangs during semver operations
  • Monitoring alerts for regex execution timeouts in application logs

Detection Strategies

  • Implement Software Composition Analysis (SCA) tools to identify vulnerable semver package versions in your dependency tree
  • Use npm audit or yarn audit to detect known vulnerabilities in project dependencies
  • Deploy runtime monitoring to detect abnormal CPU usage patterns associated with regex processing
  • Review application logs for timeout errors related to version parsing operations

Monitoring Recommendations

  • Set up alerting for sustained high CPU utilization on Node.js application servers
  • Monitor event loop lag metrics to detect blocking operations
  • Implement request timeout thresholds for endpoints processing user-supplied version strings
  • Use SentinelOne's Singularity Platform to monitor for process behavior anomalies indicative of DoS conditions

How to Mitigate CVE-2022-25883

Immediate Actions Required

  • Update the semver package to version 7.5.2 or later immediately
  • Audit your application's dependency tree for transitive dependencies on vulnerable semver versions
  • Implement input validation to limit the length and complexity of user-supplied version range strings
  • Consider implementing request timeouts on endpoints that process version strings

Patch Information

The vulnerability has been addressed in semver version 7.5.2. The fix preprocesses input strings to normalize whitespace before applying regex patterns, eliminating the conditions that enable catastrophic backtracking. The patch is available via the GitHub Pull Request #564 and GitHub Commit 717534ee.

Additional security information is available in the Snyk Vulnerability Database and NetApp Security Advisory.

Workarounds

  • If immediate upgrade is not possible, implement input sanitization to strip excessive whitespace from version range inputs before passing to semver
  • Apply request rate limiting on endpoints that accept version range parameters
  • Set execution timeouts for semver parsing operations to prevent extended CPU consumption
  • Consider using alternative version parsing approaches for user-supplied input validation
bash
# Update semver to the patched version
npm update semver
# Or install the specific patched version
npm install semver@7.5.2

# Audit your project for vulnerable dependencies
npm audit

# Fix vulnerabilities automatically where possible
npm audit fix

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechNpmjs

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.58%

  • 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 Range.js Code Review

  • GitHub Internal Re.js Code Review

  • GitHub Internal Re.js Code Review

  • NetApp Security Advisory ntap-20241025-0004
  • Vendor Resources
  • GitHub Commit 717534ee

  • GitHub Pull Request #564

  • Snyk Vulnerability SNYK-JS-SEMVER-3247795
  • Related CVEs
  • CVE-2021-39134: Npmjs Arborist RCE 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