xgrammar
CVE-2026-25048
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessReach LLM endpoint using xgrammar
-
DeliverySubmit deeply nested grammar/schema
-
ExploitTrigger uncontrolled recursion in parser
-
ExecutionExhaust native stack, segmentation fault
-
ImpactWorker process crashes, service denied
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V15 - Secure Coding and Architecture Recursion depth limits
|
| Exploitation Conditions | Exploitation requires that the target deployment uses xgrammar (versions before 0.1.32) for structured/guided generation AND that the attacker can supply or influence the grammar/JSON-schema input processed by the library - the specific trigger is multi-level deeply nested grammar syntax that drives uncontrolled recursion to a segfault. Per the CVSS vector (PR:N/UI:N/AC:L) no authentication, user interaction, or special configuration is otherwise needed, so against an endpoint that accepts client-controlled grammars this is unauthenticated and low-complexity. The principal limiting factor is exposure of the grammar input: deployments that only use fixed, server-side trusted grammars/schemas and never pass attacker-controlled grammar definitions to xgrammar are not realistically reachable. Impact is limited to availability (process crash); no code execution, data disclosure, or integrity impact results. |
| Impact | The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) describes a network-reachable, low-complexity, unauthenticated trigger, and the impact is purely availability (VA:H; VC:N/VI:N/VA only) - a crash/DoS, not code execution or data exposure. This is internally consistent with CWE-674 and the segfault description. The signals diverge on likelihood: CVSS base severity is High (8.7), but EPSS is only 0.06% (17th percentile), there is no CISA KEV listing, and no POC is referenced, so real-world risk is moderate-to-low and likely opportunistic at best. Note a data conflict: the input Tags label this 'Information Disclosure,' but the CVSS vector explicitly sets VC:N (no confidentiality impact) - the authoritative metrics indicate availability-only, so the 'Information Disclosure' tag appears to be mislabeled and should not drive prioritization. Practical priority: patch promptly on internet-exposed inference endpoints that accept attacker-controlled grammars/schemas, but this is not a critical drop-everything issue absent active exploitation. |
| Exploit ScenarioDerived | An attacker submits a generation request to an internet-facing LLM serving endpoint that uses xgrammar for guided decoding, supplying a maliciously crafted grammar or JSON schema with many levels of nested structure. When xgrammar compiles/matches the deeply nested syntax it recurses until the stack is exhausted, segfaults, and terminates the worker process, denying service to all users; given AV:N/AC:L/PR:N, this requires only network access and no authentication, though no public POC is currently referenced. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv5 – Jun 30, 2026
Denial of service in the mlc-ai xgrammar structured-generation library (versions prior to 0.1.32) allows remote attackers to crash the host process via deeply multi-level nested grammar syntax that triggers a segmentation fault (core dump). Because xgrammar is typically embedded in LLM inference servers to constrain model output, an attacker who can influence the grammar/schema passed to the engine can take the service offline. No public exploit identified at time of analysis, and EPSS exploitation probability is very low (0.06%), but the issue is fixed and has been picked up in multiple Red Hat advisories.
Earlier versions of this analysis (4)
Denial of service in xgrammar before 0.1.32 lets an attacker crash the host process via a crafted grammar containing multi-level nested syntax, which triggers a segmentation fault (core dumped) in the structured-generation engine. Because xgrammar is embedded in LLM inference and serving stacks (Red Hat shipped fixes via RHSA-2026:5809/6761/6762), a single malformed grammar or schema can take down model-serving workers. No public exploit has been identified at time of analysis, and EPSS is very low (0.06%, 17th percentile), indicating no observed exploitation activity.
Denial of service in xgrammar (mlc-ai) before 0.1.32 allows attackers to crash the host process via a structured-generation grammar containing multi-level nested syntax, which triggers a segmentation fault (core dumped). Because xgrammar is embedded in LLM inference/serving stacks, any interface that accepts attacker-controlled grammars or JSON schemas can be abused to take down the worker. No public exploit is identified at time of analysis and EPSS is low (0.06%), but the CVSS 4.0 score of 8.7 reflects an unauthenticated, network-reachable availability impact.
Denial of service in mlc-ai's xgrammar structured-generation library (versions <= 0.1.31) lets a client crash the host process by submitting a grammar with deeply nested syntax. When the GrammarCompiler parses a rule containing roughly 30,000 layers of nested parentheses, uncontrolled recursion exhausts the stack and produces a segmentation fault, terminating any LLM inference server that compiles caller-supplied grammars. Publicly available exploit code exists in the GitHub Security Advisory; the issue is not in CISA KEV and EPSS is low (0.06%), indicating no observed widespread exploitation.
xgrammar is an open-source library for efficient, flexible, and portable structured generation. Prior to version 0.1.32, the multi-level nested syntax caused a segmentation fault (core dumped).
RemediationAI
Vendor-released patch: upgrade xgrammar to version 0.1.32 or later (https://github.com/mlc-ai/xgrammar/releases/tag/v0.1.32), per advisory GHSA-7rgv-gqhr-fxg3. If you consume xgrammar through a Red Hat product, apply the corresponding errata (RHSA-2026:5809, RHSA-2026:6761, RHSA-2026:6762, or RHSA-2026:24977) to pick up the rebuilt package. Where immediate upgrade is not possible, reduce exposure by not allowing untrusted clients to supply arbitrary grammars/JSON schemas to the inference engine - restrict grammar input to server-side trusted templates, and add input validation that rejects excessively deep nesting before it reaches the parser (trade-off: legitimate deeply-nested schemas would be refused). Additionally place the inference endpoint behind authentication/rate limiting and run the worker under a supervisor that auto-restarts on crash to limit DoS dwell time (trade-off: restart-on-crash masks but does not prevent repeated outages).
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
xgrammar is an open-source library (vendor mlc-ai, CPE cpe:2.3:a:mlc-ai:xgrammar) that compiles context-free grammars/JSON schemas into constraints for structured/guided generation in large language model serving stacks. The flaw is classified as CWE-674 (Uncontrolled Recursion): the grammar parser/matcher recurses without an effective depth bound, so multi-level nested syntax drives the parser into unbounded recursion that exhausts the native stack and causes a segmentation fault (core dumped). This is a memory-safety/availability failure in the native (C++/compiled) grammar-processing path rather than a logic bug in the Python wrapper, which is why it manifests as a process-terminating crash rather than a handled exception.
Know when Xgrammar gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Network-reachable, low-complexity, unauthenticated trigger via attacker-supplied nested grammar; impact is process crash only, so C:N/I:N and A:H with unchanged scope.
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
7DescriptionCVE.org
xgrammar is an open-source library for efficient, flexible, and portable structured generation. Prior to version 0.1.32, the multi-level nested syntax caused a segmentation fault (core dumped). This issue has been patched in version 0.1.32.
Executive ViewAI
The mlc-ai xgrammar library used in LLM inference services contains a denial-of-service vulnerability that enables attackers to crash inference servers, directly impacting availability of AI-driven applications. Organizations running xgrammar versions prior to 0.1.32 face service disruption risk, particularly if they accept external schema inputs. A vendor patch is available and deployment is straightforward.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
Affected Products (CPE)CVE.org
XGrammar is an open-source library for efficient, flexible, and portable structured generation. Rated high severity (CVS
XGrammar is an open-source library for efficient, flexible, and portable structured generation. Rated medium severity (C
xgrammar is an open-source library for efficient, flexible, and portable structured generation. Rated medium severity (C
GHSA-7rgv-gqhr-fxg3
NVD
CVE.org
EPSS
VulDB
Exploit-DB