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

CVE-2022-35949: Node.js Undici SSRF Vulnerability

CVE-2022-35949 is an SSRF vulnerability in Node.js Undici that allows attackers to manipulate hostnames through user-controlled path parameters. This article covers technical details, affected versions, impact, and mitigation.

Published: February 11, 2026

CVE-2022-35949 Overview

CVE-2022-35949 is a Server-Side Request Forgery (SSRF) vulnerability in undici, a high-performance HTTP/1.1 client written from scratch for Node.js. The vulnerability exists in how the library handles the path/pathname option of undici.request when processing user-supplied input.

When an application passes user input into the path or pathname parameter of undici.request, an attacker can manipulate the request destination by providing specially crafted URLs such as http://127.0.0.1 or //127.0.0.1. Instead of treating this as a relative path appended to the base URL, the library incorrectly processes it as an absolute URL, causing requests to be sent to an attacker-controlled destination.

Critical Impact

This SSRF vulnerability allows attackers to bypass hostname restrictions and redirect requests to internal services, potentially accessing sensitive resources, internal APIs, or cloud metadata endpoints that should not be externally accessible.

Affected Products

  • nodejs undici (versions prior to 5.8.1)

Discovery Timeline

  • 2022-08-12 - CVE-2022-35949 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-35949

Vulnerability Analysis

The vulnerability stems from a fundamental flaw in how undici handles URL construction when combining user-provided path parameters with a base origin URL. When developers pass user input into the path parameter of undici.request, they reasonably assume that the hostname will remain fixed to the configured origin. However, due to the behavior of JavaScript's URL constructor, if the path parameter contains an absolute URL or a protocol-relative URL (starting with //), the resulting request is redirected to an entirely different host.

For example, when a developer configures a request with origin: "http://example.com" and a user supplies pathname: "//127.0.0.1", the expectation would be a request to http://example.com//127.0.0.1. Instead, the URL constructor interprets //127.0.0.1 as a protocol-relative URL, overriding the origin and sending the request to http://127.0.0.1/. This allows attackers to probe internal networks, access cloud instance metadata services (such as 169.254.169.254), or interact with localhost services.

Root Cause

The root cause lies in the unsafe usage of JavaScript's URL constructor with user-controlled input. When new URL(path, origin) is called, if the path parameter is an absolute URL, the origin (second parameter) is completely ignored. The undici library failed to properly sanitize or validate the path parameter to ensure it remained a relative path before passing it to the URL constructor.

Attack Vector

This vulnerability is exploitable over the network without authentication. An attacker needs to find an application endpoint that accepts user input and passes it to the path or pathname option of undici.request. The attack requires no user interaction and can be executed with a simple malicious input string such as //127.0.0.1 or http://internal-service/.

javascript
// Vulnerable usage pattern
const undici = require("undici")

// Developer expects request to go to example.com
// But attacker-controlled pathname causes SSRF
undici.request({
  origin: "http://example.com",
  pathname: "//127.0.0.1"  // Attacker input
})
// Request actually goes to http://127.0.0.1/

The security patch addresses this by ensuring paths always start with a forward slash and by concatenating the origin and path as strings rather than relying on the URL constructor's potentially dangerous base URL behavior:

javascript
// Security patch in index.js
         throw new InvalidArgumentError('invalid opts.path')
       }
 
-      url = new URL(opts.path, util.parseOrigin(url))
+      let path = opts.path
+      if (!opts.path.startsWith('/')) {
+        path = `/${path}`
+      }
+
+      url = new URL(util.parseOrigin(url).origin + path)
     } else {
       if (!opts) {
         opts = typeof url === 'object' ? url : {}

Source: GitHub Commit Reference

javascript
// Security patch in lib/core/util.js
     const port = url.port != null
       ? url.port
       : (url.protocol === 'https:' ? 443 : 80)
-    const origin = url.origin != null
+    let origin = url.origin != null
       ? url.origin
       : `${url.protocol}//${url.hostname}:${port}`
-    const path = url.path != null
+    let path = url.path != null
       ? url.path
       : `${url.pathname || ''}${url.search || ''}`
 
-    url = new URL(path, origin)
+    if (origin.endsWith('/')) {
+      origin = origin.substring(0, origin.length - 1)
+    }
+
+    if (path && !path.startsWith('/')) {
+      path = `/${path}`
+    }
+    // new URL(path, origin) is unsafe when `path` contains an absolute URL
+    // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:
+    // If first parameter is a relative URL, second param is required, and will be used as the base URL.
+    // If first parameter is an absolute URL, a given second param will be ignored.
+    url = new URL(origin + path)
   }
 
   return url

Source: GitHub Commit Reference

Detection Methods for CVE-2022-35949

Indicators of Compromise

  • Unexpected outbound HTTP requests from Node.js applications to internal IP addresses (127.0.0.1, 10.x.x.x, 172.16.x.x, 192.168.x.x)
  • Requests to cloud metadata endpoints (169.254.169.254) from application servers
  • HTTP requests containing path parameters starting with // or containing full URLs like http:// or https://
  • Unusual response patterns indicating access to internal services

Detection Strategies

  • Monitor application logs for user-supplied path values containing absolute URLs or protocol-relative URLs (starting with //)
  • Implement web application firewall (WAF) rules to detect and block requests with suspicious path patterns
  • Deploy network-level monitoring to identify unexpected connections from application servers to internal resources
  • Audit dependency versions using npm audit or similar tools to identify vulnerable undici versions

Monitoring Recommendations

  • Enable detailed logging for all undici.request calls, particularly capturing the path and origin parameters
  • Set up alerts for any outbound requests from application servers to localhost or private IP ranges
  • Monitor for failed connection attempts to internal services that may indicate SSRF probing
  • Implement egress filtering to restrict application servers from making arbitrary outbound connections

How to Mitigate CVE-2022-35949

Immediate Actions Required

  • Update undici to version 5.8.1 or later immediately using npm update undici or yarn upgrade undici
  • Audit all code paths where user input is passed to undici.request path or pathname parameters
  • Implement strict input validation for any user-controlled URL components before passing them to undici
  • Review application logs for evidence of exploitation attempts

Patch Information

The vulnerability was fixed in undici version 5.8.1. The patch ensures that user-supplied path values are properly sanitized by prepending a forward slash if missing and using string concatenation instead of the URL constructor's base URL behavior. For detailed technical changes, refer to the GitHub Security Advisory GHSA-8qr4-xgw6-wmr3 and the official release v5.8.2.

Workarounds

  • Validate user input before passing it to undici.request to ensure it does not contain absolute URLs or protocol-relative URLs
  • Implement an allowlist of permitted path patterns and reject any input that doesn't match
  • Use URL parsing to extract only the pathname component and reject input containing hostname or protocol information
  • Consider implementing a proxy or gateway that validates and sanitizes outbound requests
bash
# Update undici to patched version
npm update undici

# Verify installed version
npm list undici

# Run security audit
npm audit

# Force update if needed
npm install undici@latest

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

  • Vulnerability Details
  • TypeSSRF

  • Vendor/TechNodejs

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.39%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-918
  • Technical References
  • GitHub Release v5.8.2
  • Vendor Resources
  • GitHub Commit Reference

  • GitHub Security Advisory GHSA-8qr4-xgw6-wmr3
  • Related CVEs
  • CVE-2024-29415: Node.js IP Package SSRF Vulnerability

  • CVE-2026-21711: Node.js Privilege Escalation Vulnerability

  • CVE-2026-21712: Node.js URL Processing DoS Vulnerability

  • CVE-2026-21710: Node.js HTTP DOS 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