CVE-2025-58446
Python vulnerability analysis and mitigation

Overview

CVE-2025-58446 affects xgrammar, an open-source library for efficient, flexible, and portable structured generation. The vulnerability was discovered in version 0.1.23 and was fixed in version 0.1.24. The issue involves a grammar optimizer that processes large grammars (>100k characters) at very low rates, which can be exploited for denial of service attacks against model providers (GitHub Advisory).

Technical details

The vulnerability stems from a performance regression in the grammar optimizer introduced in version 0.1.23. When processing grammars larger than 100k characters, the optimizer performs significantly slower than expected. The issue is particularly noticeable when handling large enum grammars, where the grammar parsing time exceeds the LLM processing time itself. The vulnerability has been assigned a CVSS v4.0 Base Score of 6.9 (MEDIUM) with the vector string: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N (NVD).

Impact

The vulnerability can be exploited to perform denial of service (DOS) attacks against model providers. The affected grammar optimizer processes large grammars at such low rates that it significantly impacts performance, with grammar parsing taking longer than the actual LLM processing. This can effectively bottleneck the system and degrade service quality (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been fixed in xgrammar version 0.1.24. The fix optimizes the speed of the grammar optimizer and disables certain slow optimizations for large grammars. Users are advised to upgrade to version 0.1.24 or later to address this vulnerability (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-57817HIGH8.6
  • PythonPython
  • ethyca-fides
NoYesSep 08, 2025
CVE-2025-58446MEDIUM6.9
  • PythonPython
  • xgrammar
NoYesSep 06, 2025
CVE-2025-57816MEDIUM6.3
  • PythonPython
  • ethyca-fides
NoYesSep 08, 2025
CVE-2025-57815LOW1.7
  • PythonPython
  • ethyca-fides
NoYesSep 08, 2025
CVE-2025-57766LOW1.7
  • PythonPython
  • ethyca-fides
NoYesSep 08, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management