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-2025-57809

CVE-2025-57809: Mlc-ai Xgrammar DoS Vulnerability

CVE-2025-57809 is a denial of service flaw in Mlc-ai Xgrammar caused by infinite recursion in grammar processing. This vulnerability can crash the application. Learn about affected versions and how to mitigate this issue.

Published: April 22, 2026

CVE-2025-57809 Overview

CVE-2025-57809 is an infinite recursion vulnerability affecting XGrammar, an open-source library for efficient, flexible, and portable structured generation. Prior to version 0.1.21, XGrammar contains a flaw in its grammar processing that can trigger infinite recursion, leading to a denial of service condition. This issue has been resolved in version 0.1.21 through a significant architectural change that replaces the pushdown automata with an Earley parser.

Critical Impact

Attackers can remotely trigger infinite recursion in XGrammar's grammar processing, causing application crashes and denial of service without requiring authentication or user interaction.

Affected Products

  • mlc-ai XGrammar versions prior to 0.1.21

Discovery Timeline

  • August 25, 2025 - CVE-2025-57809 published to NVD
  • September 9, 2025 - Last updated in NVD database

Technical Details for CVE-2025-57809

Vulnerability Analysis

The vulnerability resides in XGrammar's grammar parsing implementation, which previously utilized a pushdown automata approach. This design introduced a critical flaw where certain grammar constructs could trigger uncontrolled recursive function calls (CWE-674). When processing specially crafted input, the parser would enter an infinite recursion loop, consuming stack space until the application crashes or becomes unresponsive.

The vulnerability is exploitable over the network without requiring any privileges or user interaction, making it particularly dangerous for applications that expose XGrammar's functionality to untrusted input sources. The impact is limited to availability—there is no direct compromise of confidentiality or integrity, but the denial of service can be severe for production systems relying on this library for structured generation tasks.

Root Cause

The root cause is the lack of recursion depth limiting in the pushdown automata-based grammar parser. The original implementation did not include safeguards against grammar rules that could create cycles or deeply nested recursive patterns, allowing malicious or malformed input to exploit this behavior.

Attack Vector

An attacker can exploit this vulnerability by submitting specially crafted grammar rules or input that triggers the recursive parsing path. Since the attack vector is network-based and requires no authentication, any application exposing XGrammar's parsing functionality to external input is potentially vulnerable. The attack does not require complex conditions to execute successfully.

c
// Security patch showing architectural change to Earley parser
// Source: https://github.com/mlc-ai/xgrammar/commit/b943feacb5a1caf4d39de8ec3bf7c7ce066dcee5

 #include <utility>
 #include <vector>
 
+#include "earley_parser.h"
+
 // matcher_data_structure.h is included to use StackElement
 #include "persistent_stack.h"
 #include "support/dynamic_bitset.h"

The fix introduces an Earley parser to replace the vulnerable pushdown automata implementation. The Earley parsing algorithm is better suited to handle complex grammar constructs without falling into infinite recursion, as it uses a chart-based approach rather than recursive descent.

Detection Methods for CVE-2025-57809

Indicators of Compromise

  • Abnormally high CPU utilization in processes using XGrammar library
  • Stack overflow crashes in applications utilizing grammar parsing functionality
  • Repeated application restarts or service interruptions correlating with grammar processing requests
  • Memory consumption spikes followed by process termination

Detection Strategies

  • Monitor application logs for stack overflow exceptions or segmentation faults in XGrammar-related code paths
  • Implement resource monitoring to detect runaway CPU or memory usage in services using XGrammar
  • Deploy application performance monitoring (APM) to identify hung or unresponsive grammar processing threads
  • Review dependency manifests to identify XGrammar versions prior to 0.1.21

Monitoring Recommendations

  • Set up alerts for process crashes in applications using the XGrammar library
  • Implement request timeout monitoring for endpoints that process grammar-based input
  • Track resource consumption metrics (CPU, memory, thread count) for services utilizing XGrammar
  • Enable core dump collection to assist in post-incident analysis of crash events

How to Mitigate CVE-2025-57809

Immediate Actions Required

  • Upgrade XGrammar to version 0.1.21 or later immediately
  • Audit all applications and services for XGrammar dependency usage
  • Implement input validation and size limits for grammar-related inputs as a defense-in-depth measure
  • Consider temporarily disabling grammar processing features in production until patching is complete

Patch Information

The vulnerability has been addressed in XGrammar version 0.1.21. The fix involves a significant architectural change, replacing the pushdown automata parser with an Earley parser implementation that properly handles recursive grammar constructs. The security patch is available via the GitHub Commit. Additional details can be found in the GitHub Security Advisory.

Workarounds

  • Implement request timeouts for any operations involving grammar parsing
  • Add recursion depth limits at the application level if possible
  • Deploy rate limiting on endpoints that accept grammar input to reduce attack surface
  • Isolate XGrammar processing in sandboxed environments to contain potential crashes
bash
# Upgrade XGrammar to the patched version
pip install --upgrade xgrammar>=0.1.21

# Verify installed version
pip show xgrammar | grep Version

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechMlc Ai Xgrammar

  • SeverityHIGH

  • CVSS Score7.7

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-674
  • Technical References
  • GitHub Issue Discussion
  • Vendor Resources
  • GitHub Commit Update

  • GitHub Security Advisory
  • Latest CVEs
  • CVE-2026-8468: Elixir Plug Library DoS Vulnerability

  • CVE-2026-8295: simdjson Information Disclosure Vulnerability

  • CVE-2025-68421: Comarch ERP Optima Auth Bypass Vulnerability

  • CVE-2025-68420: Comarch ERP Optima Privilege Escalation
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