
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-25048 is a Denial of Service (DoS) vulnerability in xgrammar, an open-source Python library by mlc-ai for efficient, flexible, and portable structured generation used in LLM inference pipelines. The vulnerability exists in versions up to and including 0.1.31, where processing multi-level nested grammar syntax triggers uncontrolled recursion, causing a segmentation fault (core dump). It was disclosed on March 5, 2026, by researcher ylwango613 via the GitHub Security Advisory GHSA-7rgv-gqhr-fxg3. The vulnerability carries a CVSS v3.1 score of 7.5 (High) and a CVSS v4.0 score of 8.7 (High) (GitHub Advisory, Red Hat Bugzilla).
The root cause is CWE-674 (Uncontrolled Recursion): xgrammar's grammar compiler does not impose limits on recursion depth when parsing nested grammar rules, allowing the call stack or memory to be exhausted. An attacker can craft a malicious grammar string containing an extreme number of nested parentheses (e.g., 30,000 layers) and submit it to any application that passes user-controlled input to xgr.GrammarCompiler.compile_grammar(). No authentication, privileges, or user interaction are required — the attack vector is network-accessible wherever the library processes externally supplied grammar strings. A public PoC written in Python is available in the official security advisory, demonstrating the crash with a grammar of the form root ::= (((...a...))) with 30,000 nesting levels (GitHub Advisory).
Successful exploitation causes the host process to crash with a segmentation fault, resulting in complete loss of availability for any service relying on xgrammar for structured generation (e.g., LLM inference APIs). There is no impact on confidentiality or data integrity — the vulnerability is purely a DoS condition. Repeated exploitation could keep a targeted service continuously unavailable, and in multi-tenant or shared inference environments, a single crash may affect all users of that service (GitHub Advisory, Feedly).
A public proof-of-concept (PoC) Python script is included in the official GitHub Security Advisory and demonstrates reliable crash reproduction on xgrammar 0.1.31. The EPSS score is approximately 0.042% (24th percentile), indicating low current exploitation probability. There is no evidence of in-the-wild exploitation, no known threat actor attribution, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog as of the time of this report (GitHub Advisory, Feedly).
s = '(' * 30000 + 'a' and grammar = f'root ::= {s}', which creates 30,000 layers of nested parentheses.xgr.GrammarCompiler(tokenizer_info).compile_grammar(malicious_grammar), the uncontrolled recursion exhausts the stack or memory, causing a segmentation fault and crashing the process.Segmentation fault (core dumped) messages from the Python process running xgrammar; absence of a clean shutdown sequence.core, core.<pid>) generated in the working directory of the xgrammar-using application.core.*) in the application's working directory following service crashes (GitHub Advisory).The primary remediation is to upgrade xgrammar to version 0.1.32 or later, which patches the uncontrolled recursion issue (pip install xgrammar>=0.1.32) (GitHub Release). If immediate patching is not feasible, implement input validation to reject grammar strings exceeding a safe nesting depth before passing them to compile_grammar(). Additionally, monitor applications for unexpected crashes or segmentation faults that may indicate exploitation attempts. Red Hat has also issued advisories (RHSA-2026:5809, RHSA-2026:6761, RHSA-2026:6762) for affected downstream packages (Red Hat Bugzilla).
The vulnerability was reported by researcher ylwango613 and published by the xgrammar maintainer Seven-Streams via GitHub's security advisory process on March 5, 2026. Red Hat tracked the issue via Bugzilla (Bug 2444840) and subsequently issued multiple errata (RHSA-2026:5809, RHSA-2026:6761, RHSA-2026:6762), indicating downstream impact on Red Hat products that bundle xgrammar. Community discussion was limited, with automated vulnerability aggregators (Vulners, VulDB, CIRCL) picking up the advisory shortly after disclosure; no significant independent researcher commentary or media coverage was identified (Red Hat Bugzilla, GitHub Advisory).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."