CVE-2025-57809 XGrammar affected by Denial of Service by infinite recursion grammars

High 7.7 Published Updated
Exploited in the wild
Not known
Fix
Available

What is CVE-2025-57809?

CVE-2025-57809 is a high-severity vulnerability in mlc-ai xgrammar, published on 25 Aug 2025.

Official description

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.

Weakness: CWE-674

Which versions are affected by CVE-2025-57809?

3 open source packages ship an affected version, including xgrammar. It affects 1 product.

PackageAffectedFixed in
xgrammar PyPIAll versions0.1.21
xgrammar PyPIAll versions0.1.21
xgrammar PyPIAll versions0.1.21

Products include Mlc-Ai Xgrammar.

How do I fix CVE-2025-57809?

Upgrade xgrammar to 0.1.21 or later.

Is CVE-2025-57809 being exploited?

There is no known exploitation of CVE-2025-57809 in the wild and no public exploit code.

Sources

Also known as GHSA-5cmr-4px5-23pc, PYSEC-2026-2054.

Is CVE-2025-57809 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free