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

CVE-2022-25857: Snakeyaml DoS Vulnerability

CVE-2022-25857 is a Denial of Service flaw in Snakeyaml caused by missing nested depth limitation for collections. This article covers the technical details, affected versions, security impact, and mitigation.

Published: February 17, 2026

CVE-2022-25857 Overview

CVE-2022-25857 is a Denial of Service (DoS) vulnerability affecting the SnakeYAML Java library, a popular YAML parser widely used in Java applications for configuration parsing and data serialization. The vulnerability exists in SnakeYAML versions from 0 up to (but not including) 1.31, where the library fails to enforce nested depth limitations for collections during YAML parsing operations.

This flaw allows attackers to craft malicious YAML documents with deeply nested structures that, when parsed, can exhaust system resources and cause application crashes or unresponsiveness. The vulnerability was detected through OSS-Fuzz, a continuous fuzzing service for open source software.

Critical Impact

Applications using vulnerable SnakeYAML versions can be rendered unavailable through carefully crafted YAML input with excessive nesting, potentially disrupting critical services that rely on YAML configuration parsing.

Affected Products

  • SnakeYAML Project SnakeYAML versions 0 to 1.30
  • Debian Linux 10.0
  • Any Java application with a direct or transitive dependency on vulnerable SnakeYAML versions

Discovery Timeline

  • 2022-08-30 - CVE-2022-25857 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-25857

Vulnerability Analysis

The vulnerability stems from SnakeYAML's YAML parsing implementation lacking proper safeguards against deeply nested data structures. When the library processes a YAML document, it recursively parses nested collections (such as maps and sequences) without enforcing a maximum depth limit. This absence of depth validation creates an opportunity for resource exhaustion attacks.

An attacker can exploit this weakness by providing YAML input containing hundreds or thousands of nested levels. As SnakeYAML attempts to parse these structures, the recursive nature of the parsing process leads to stack exhaustion (stack overflow) or excessive memory consumption, ultimately causing the application to crash or become unresponsive.

The vulnerability is classified under CWE-776 (Improper Restriction of Recursive Entity References in DTDs), which relates to recursive processing vulnerabilities where unbounded recursion can lead to denial of service conditions.

Root Cause

The root cause of CVE-2022-25857 is the absence of a configurable nesting depth limit in SnakeYAML's LoaderOptions class. Prior to version 1.31, the library would accept and attempt to parse YAML documents regardless of how deeply structures were nested, without any protective boundaries.

The fix introduces a nestingDepthLimit property (defaulting to 50) that restricts how deeply nested collections can be parsed:

java
    private boolean allowRecursiveKeys = false;
    private boolean processComments = false;
    private boolean enumCaseSensitive = true;
+    private int nestingDepthLimit = 50;

    public boolean isAllowDuplicateKeys() {
        return allowDuplicateKeys;

Source: GitHub Commit Overview

Attack Vector

The attack vector for this vulnerability is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Identifying an application endpoint that accepts YAML input (configuration files, API payloads, user-submitted data)
  2. Crafting a malicious YAML document with deeply nested collections exceeding the application's resource handling capacity
  3. Submitting the malicious payload to the vulnerable application
  4. The SnakeYAML parser attempts to process the deeply nested structure, consuming excessive stack space or memory until the application crashes

The changelog documents the security fix:

text
     </properties>
     <body>
         <release version="1.31" date="in Git" description="Maintenance">
+            <action dev="asomov" type="fix" issue="525">
+                Restrict nested depth for collections to avoid DoS attacks (detected by OSS-Fuzz)
+            </action>
             <action dev="asomov" type="add" issue="525">
                 Add test for stackoverflow
             </action>

Source: GitHub Commit Overview

Detection Methods for CVE-2022-25857

Indicators of Compromise

  • Sudden application crashes or Java StackOverflowError exceptions when processing YAML input
  • Abnormal memory consumption spikes during YAML parsing operations
  • Application log entries showing recursive parsing failures or out-of-memory errors
  • Repeated requests containing unusually large YAML payloads targeting configuration endpoints

Detection Strategies

  • Implement Software Composition Analysis (SCA) to identify SnakeYAML dependencies in your codebase with versions prior to 1.31
  • Monitor application logs for java.lang.StackOverflowError or java.lang.OutOfMemoryError exceptions correlating with YAML processing
  • Configure Web Application Firewalls (WAF) to inspect and limit the depth of nested structures in YAML payloads
  • Use runtime application self-protection (RASP) solutions to detect anomalous recursive parsing behavior

Monitoring Recommendations

  • Set up alerts for unusual resource consumption patterns in Java applications that process YAML
  • Monitor endpoint response times for degradation that may indicate DoS attempts
  • Track and baseline typical YAML payload sizes and complexity to identify anomalous submissions
  • Enable verbose logging for YAML parsing operations to capture detailed error information

How to Mitigate CVE-2022-25857

Immediate Actions Required

  • Upgrade SnakeYAML to version 1.31 or later immediately across all affected applications
  • Conduct a dependency audit to identify all direct and transitive uses of SnakeYAML in your environment
  • Review and restrict access to endpoints that accept YAML input until patches are applied
  • Implement input validation to limit YAML payload sizes before they reach the parser

Patch Information

The SnakeYAML project has released version 1.31 which addresses this vulnerability by introducing a configurable nestingDepthLimit parameter with a default value of 50. The fix is available through the following resources:

  • GitHub Commit Overview
  • Bitbucket Commit Overview
  • Snyk Vulnerability Report

For Debian users, refer to the Debian LTS Security Announcement for distribution-specific update instructions.

Workarounds

  • Implement application-level input validation to reject YAML documents exceeding a reasonable size or structural complexity threshold
  • Use a preprocessing step to analyze YAML structure depth before passing to SnakeYAML for full parsing
  • Consider using an alternative YAML parser with built-in depth limiting if upgrading is not immediately feasible
  • Deploy request rate limiting and payload size restrictions at the network perimeter
bash
# Maven dependency update example
# Update pom.xml to use patched version:
# <dependency>
#     <groupId>org.yaml</groupId>
#     <artifactId>snakeyaml</artifactId>
#     <version>1.31</version>
# </dependency>

# Verify current SnakeYAML version in your project
mvn dependency:tree | grep snakeyaml

# Force update to patched version
mvn versions:use-latest-versions -Dincludes=org.yaml:snakeyaml

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechSnakeyaml

  • SeverityHIGH

  • CVSS Score7.5

  • EPSS Probability0.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-776
  • Technical References
  • Bitbucket Issue Discussion

  • Debian LTS Security Announcement

  • NetApp Security Advisory
  • Vendor Resources
  • Bitbucket Commit Overview

  • GitHub Commit Overview

  • Snyk Vulnerability Report
  • Related CVEs
  • CVE-2026-1691: bolo-solo SnakeYAML RCE Vulnerability

  • CVE-2022-1471: SnakeYAML Deserialization RCE Vulnerability
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