The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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
    • 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-23476

CVE-2022-23476: Nokogiri XML Parser DoS Vulnerability

CVE-2022-23476 is a denial of service vulnerability in Nokogiri's XML parser that causes null pointer exceptions when parsing invalid markup. This article covers technical details, affected versions, impact, and mitigation.

Published: February 18, 2026

CVE-2022-23476 Overview

CVE-2022-23476 is a Null Pointer Dereference vulnerability affecting Nokogiri, an open source XML and HTML library for the Ruby programming language. Nokogiri versions 1.13.8 and 1.13.9 fail to check the return value from xmlTextReaderExpand in the method Nokogiri::XML::Reader#attribute_hash. This oversight can lead to a null pointer exception when invalid markup is being parsed, potentially causing application crashes.

Critical Impact

Applications using XML::Reader to parse untrusted inputs may be vulnerable to denial of service attacks through specially crafted malicious XML markup.

Affected Products

  • Nokogiri version 1.13.8 (Ruby gem)
  • Nokogiri version 1.13.9 (Ruby gem)

Discovery Timeline

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

Technical Details for CVE-2022-23476

Vulnerability Analysis

This vulnerability stems from improper error handling in Nokogiri's C extension code that interfaces with libxml2. Specifically, the Nokogiri::XML::Reader#attribute_hash method calls the native xmlTextReaderExpand function but fails to validate the return value before using it. When xmlTextReaderExpand encounters invalid or malformed XML markup, it returns NULL to indicate an error condition. Without proper null checking, the subsequent code attempts to dereference this null pointer when accessing c_node->properties, resulting in a null pointer exception that crashes the application.

This vulnerability is classified under CWE-252 (Unchecked Return Value), as the root cause is the missing validation of the function's return value before dereferencing. For applications that process untrusted XML input through the XML::Reader interface, an attacker can supply maliciously crafted XML data designed to trigger the error condition in xmlTextReaderExpand, causing denial of service.

Root Cause

The vulnerability exists because the native C code in ext/nokogiri/xml_reader.c does not validate the return value from xmlTextReaderExpand() before attempting to access the properties member of the returned node structure. When the function returns NULL due to parsing errors on malformed markup, the code proceeds to dereference the null pointer, causing the application to crash.

Attack Vector

An attacker can exploit this vulnerability by supplying specially crafted invalid XML markup to applications that use Nokogiri::XML::Reader#attributes or Nokogiri::XML::Reader#attribute_hash to parse untrusted input. The attack vector is network-based, requiring no authentication or user interaction. When the malformed XML is processed, the null pointer dereference triggers an unhandled exception, causing the Ruby process to crash and resulting in denial of service.

c
// Security patch from ext/nokogiri/xml_reader.c
// Source: https://github.com/sparklemotion/nokogiri/commit/85410e38410f670cbbc8c5b00d07b843caee88ce

   }
 
   c_node = xmlTextReaderExpand(c_reader);
+  if (c_node == NULL) {
+    return Qnil;
+  }
+
   c_property = c_node->properties;
   while (c_property != NULL) {
     VALUE rb_name = NOKOGIRI_STR_NEW2(c_property->name);

The patch adds a null check after the xmlTextReaderExpand call, returning Qnil (Ruby's nil) to the caller instead of proceeding with the null pointer dereference.

Detection Methods for CVE-2022-23476

Indicators of Compromise

  • Unexpected Ruby process crashes or segmentation faults when processing XML input
  • Application errors or exceptions originating from Nokogiri::XML::Reader#attribute_hash or Nokogiri::XML::Reader#attributes methods
  • Increased crash frequency in services handling user-supplied XML data

Detection Strategies

  • Audit application dependencies using bundle audit or similar Ruby gem vulnerability scanners to identify vulnerable Nokogiri versions
  • Monitor application logs for segmentation faults or null pointer exceptions during XML parsing operations
  • Implement application performance monitoring to detect unusual crash patterns in XML processing components

Monitoring Recommendations

  • Enable crash reporting and exception tracking for Ruby applications processing XML data
  • Configure alerting for repeated application restarts or process crashes
  • Monitor resource utilization patterns that may indicate denial of service attempts

How to Mitigate CVE-2022-23476

Immediate Actions Required

  • Upgrade Nokogiri to version 1.13.10 or later immediately
  • Identify affected code by searching for calls to XML::Reader#attributes or XML::Reader#attribute_hash
  • Implement input validation to reject malformed XML before processing with Nokogiri

Patch Information

Users are advised to upgrade to Nokogiri >= 1.13.10 which includes the fix for this vulnerability. The security patches are available in the following commits:

  • GitHub Commit 85410e38410
  • GitHub Commit 9fe0761c47c

For additional details, refer to the GitHub Security Advisory GHSA-qv4q-mr5r-qprj.

Workarounds

  • If immediate upgrade is not possible, implement exception handling around XML::Reader#attributes and XML::Reader#attribute_hash calls
  • Add input validation to reject obviously malformed XML before passing to Nokogiri
  • Consider using alternative parsing methods such as Nokogiri::XML::Document if the XML::Reader interface is not specifically required
bash
# Upgrade Nokogiri to patched version
gem update nokogiri

# Or specify minimum version in Gemfile
echo "gem 'nokogiri', '>= 1.13.10'" >> Gemfile
bundle update nokogiri

# Verify installed version
gem list nokogiri

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechNokogiri

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.31%

  • 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-252
  • Technical References
  • GitHub Security Advisory GHSA-qv4q-mr5r-qprj
  • Vendor Resources
  • GitHub Commit 85410e38410

  • GitHub Commit 9fe0761c47c
  • Related CVEs
  • CVE-2022-24836: Nokogiri 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