cve.bz

CVE-2025-57809 mlc-ai xgrammar: Uncontrolled Recursion

7.7 highExploit referenceEPSS 0.5%Fix available

High (7.7) in mlc-ai xgrammar. EPSS 0.5% estimated probability of exploitation activity in the next 30 days. Fixed in xgrammar 0.1.21.

On this page
XGrammar is an open-source library for efficient, flexible, and portable structured generation. Prior to version 0.1.21, XGrammar has an infinite recursion issue in the grammar. This issue has been resolved in version 0.1.21.

Severity

CVSS 4.0

7.7 high
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

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
0.5% (unchanged from 0.5% a week ago; 0.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 45th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2025-08-26. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-674 Uncontrolled Recursion
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2025-57809 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2025-57809?via=ask-ai-copy and https://cve.bz/cve/CVE-2025-57809?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2025-57809 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
mlc-ai:xgrammarbefore 0.1.21

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-5cmr-4px5-23pcPyPIxgrammar<0.1.210.1.21
PYSEC-2026-2054PyPIxgrammar<0.1.210.1.21

Red Hat

Red Hat rates this Important.

Red Hat's statement

This vulnerability is considered Important because it can be exploited remotely, without authentication or user interaction, and directly impacts the availability of systems that rely on xgrammar for structured output parsing. Unlike a Moderate flaw that might require unusual conditions or only cause partial degradation, the infinite recursion issue reliably leads to process termination or complete resource exhaustion when malicious input is supplied. Since xgrammar is often integrated into long-running LLM inference services or API backends, a single crafted grammar can consistently force these services into a denial-of-service state, making it a practical, high-impact attack vector. While it does not compromise confidentiality or integrity, the ease of exploitation, network accessibility, and total loss of availability elevate it from a moderate to an important security issue.

Red Hat's mitigation

Mitigation is either unavailable or does not meet Red Hat Product Security standards for usability, deployment, applicability, or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux AI 1.5rhelai1/instructlab-intel-rhel9:1.5.4-1761050413Fixed 2025-11-03RHSA-2025:19421
Red Hat Enterprise Linux AI 1.5rhelai1/bootc-intel-rhel9:1.5.4-1761060689Fixed 2025-11-03RHSA-2025:19422
Red Hat Enterprise Linux AI 1.5rhelai1/instructlab-nvidia-rhel9:1.5.4-1761220254Fixed 2025-11-03RHSA-2025:19423
Red Hat Enterprise Linux AI 1.5rhelai1/bootc-azure-amd-rhel9:1.5.4-1761073793Fixed 2025-11-03RHSA-2025:19424
Red Hat Enterprise Linux AI 1.5rhelai1/instructlab-amd-rhel9:1.5.4-1761043227Fixed 2025-11-03RHSA-2025:19425
Red Hat Enterprise Linux AI 1.5rhelai1/bootc-gcp-nvidia-rhel9:1.5.4-1761236079Fixed 2025-11-03RHSA-2025:19426
Red Hat Enterprise Linux AI 1.5rhelai1/bootc-amd-rhel9:1.5.4-1761064179Fixed 2025-11-03RHSA-2025:19427
Red Hat Enterprise Linux AI 1.5rhelai1/bootc-nvidia-rhel9:1.5.4-1761228838Fixed 2025-11-03RHSA-2025:19428
Red Hat Enterprise Linux AI 1.5rhelai1/bootc-aws-nvidia-rhel9:1.5.4-1761236150Fixed 2025-11-03RHSA-2025:19429
Red Hat Enterprise Linux AI 1.5rhelai1/bootc-azure-nvidia-rhel9:1.5.4-1761238736Fixed 2025-11-03RHSA-2025:19430
Red Hat AI Inference Serverrhaiis/vllm-cuda-rhel9Affected
Red Hat AI Inference Serverrhaiis/vllm-rocm-rhel9Affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2025-57809.

Attack patterns (CAPEC)

  • CAPEC-230 Serialized Data with Nested Payloads Likelihood: Medium · Severity: High
  • CAPEC-231 Oversized Serialized Data Payloads Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON