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
    • 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-24795

CVE-2022-24795: Yajl-ruby Heap Corruption DoS Vulnerability

CVE-2022-24795 is a heap memory corruption vulnerability in Yajl-ruby caused by integer overflow when processing large inputs. This article covers the technical details, affected versions, and mitigations.

Published: February 17, 2026

CVE-2022-24795 Overview

CVE-2022-24795 is an integer overflow vulnerability affecting yajl-ruby, a C binding to the YAJL JSON parsing and generation library. Both the 1.x and 2.x branches of yajl contain an integer overflow that leads to subsequent heap memory corruption when processing large inputs approaching 2GB in size. The vulnerability exists in the reallocation logic at yajl_buf.c#L64, where the need 32-bit integer can wrap to 0 when it approaches a value of 0x80000000 (~2GB of data). This results in a reallocation of buf->alloc into a small heap chunk, followed by population based on the original buffer size, leading to heap memory corruption.

Critical Impact

This vulnerability primarily impacts process availability through denial of service. While maintainers believe exploitation for arbitrary code execution is unlikely, the heap memory corruption could potentially lead to unpredictable application behavior.

Affected Products

  • yajl-ruby 1.x branch (all versions prior to patch)
  • yajl-ruby 2.x branch on 32-bit platforms
  • Applications using yajl-ruby for JSON parsing with large input handling

Discovery Timeline

  • April 5, 2022 - CVE-2022-24795 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2022-24795

Vulnerability Analysis

The vulnerability is classified as CWE-122 (Heap-based Buffer Overflow). The integer overflow occurs in the buffer reallocation logic within the YAJL library's C code. When processing JSON data approaching 2GB in size, the 32-bit integer used to track the required buffer size (need) wraps around to 0 due to integer overflow. This causes the memory allocator to allocate a much smaller buffer than actually required.

The 2.x branch of yajl declares these integers as size_t, which on 64-bit platforms would be a 64-bit integer, practically preventing the issue from triggering. However, on 32-bit builds where size_t is a 32-bit integer, the vulnerability remains exploitable. The subsequent write operations to the under-allocated heap chunk are based on the original (large) buffer size, resulting in heap memory corruption beyond the allocated boundaries.

Root Cause

The root cause is insufficient bounds checking on integer arithmetic in the buffer reallocation logic at yajl_buf.c#L64. When the need variable approaches 0x80000000 (approximately 2GB), the 32-bit integer wraps to 0 due to overflow, causing a minimal buffer allocation that is subsequently overwritten with data far exceeding its capacity.

Attack Vector

An attacker can exploit this vulnerability by sending specially crafted large JSON payloads (~2GB) to an application that uses yajl-ruby for JSON parsing. The attack can be conducted remotely over the network without authentication or user interaction. The primary impact is denial of service through application crash, though the heap memory corruption could potentially have broader security implications.

The security patches addressed multiple issues including depth validation:

c
         yajl_gen_invalid_number,
         /** A print callback was passed in, so there is no internal
          * buffer to get from */
-        yajl_gen_no_buf
+        yajl_gen_no_buf,
+        /** Tried to decrement at depth 0 */
+        yajl_depth_underflow
     } yajl_gen_status;

     /** an opaque handle to a generator */

Source: GitHub Commit

Additional depth checking improvements were implemented:

c
     if (++(g->depth) >= YAJL_MAX_DEPTH) return yajl_max_depth_exceeded;

 #define DECREMENT_DEPTH \
-    if (--(g->depth) >= YAJL_MAX_DEPTH) return yajl_gen_error;
+    if (--(g->depth) >= YAJL_MAX_DEPTH) return yajl_depth_underflow;

 #define APPENDED_ATOM \
     switch (g->state[g->depth]) {                   \

Source: GitHub Commit

Detection Methods for CVE-2022-24795

Indicators of Compromise

  • Unusual application crashes or segmentation faults in processes using yajl-ruby
  • Incoming JSON payloads with sizes approaching or exceeding 2GB
  • Memory allocation failures followed by heap corruption indicators
  • Abnormal process termination in Ruby applications handling JSON data

Detection Strategies

  • Monitor for unusually large HTTP request bodies containing JSON content
  • Implement application-level logging for JSON parsing operations and their input sizes
  • Deploy memory protection mechanisms that can detect heap corruption attempts
  • Use runtime application self-protection (RASP) to monitor buffer operations in yajl-ruby

Monitoring Recommendations

  • Configure web application firewalls to block excessively large JSON payloads
  • Implement request size limits at the application and infrastructure layers
  • Monitor system memory usage patterns for anomalies indicating heap corruption
  • Enable core dump analysis for post-incident forensics on affected systems

How to Mitigate CVE-2022-24795

Immediate Actions Required

  • Update yajl-ruby to version 1.4.2 or later which contains the security patch
  • Implement input size validation to reject JSON payloads approaching 2GB
  • Review applications using yajl-ruby on 32-bit platforms as they are most susceptible
  • Consider migrating 32-bit deployments to 64-bit platforms where size_t is 64-bit

Patch Information

A security patch is available in commit 7168bd79b888900aa94523301126f968a93eb3a6. This fix is anticipated to be part of yajl-ruby version 1.4.2. Organizations should update their yajl-ruby dependency to the patched version as soon as possible. For additional details, see the GitHub Security Advisory and distribution-specific advisories from Debian and Fedora.

Workarounds

  • Avoid passing large inputs (approaching 2GB) to YAJL for JSON parsing
  • Implement strict input size limits at the application boundary
  • Use alternative JSON parsing libraries if large payload handling is required
  • Deploy on 64-bit platforms where the vulnerability is practically mitigated
bash
# Configuration example - Input size limit in nginx
client_max_body_size 100m;

# Ruby-level protection - Add size check before YAJL parsing
max_json_size = 100 * 1024 * 1024  # 100MB limit
if json_input.bytesize > max_json_size
  raise "JSON input exceeds maximum allowed size"
end

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechYajl

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability1.36%

  • 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-122
  • Technical References
  • GitHub Code Snippet

  • GitHub Security Advisory

  • Debian LTS Announcement July 2023

  • Debian LTS Announcement August 2023

  • Fedora Package Announcement

  • Fedora Package Announcement
  • Vendor Resources
  • GitHub Commit Log
  • 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