# CVE-2026-17500: ggml-org llama.cpp null pointer dereference in json-schema-to-grammar

Source: https://junglewise.ai/threats/cve-2026-17500-ggml-org-llama-cpp-null-pointer-dereference-in-json-schema-to  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-27. Updated: 2026-07-27  
License: CC BY 4.0 with a link back

CVE-2026-17500 · Severity: medium · CVSS 5.3 · Published 2026-07-27

A vulnerability exists in llama.cpp, a popular library used for running Large Language Models (LLMs). By providing a specially crafted JSON schema, a remote attacker can cause the software to crash. This results in a denial-of-service, potentially interrupting AI services or applications relying on this library for processing data.

Technologies: [GGML Llama.Cpp](https://junglewise.ai/threats/technologies/llama-cpp). Vendors: [GGML](https://junglewise.ai/threats/vendors/ggml).

## Quick answers

**Is CVE-2026-17500 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-17500 being exploited in the wild.

**How severe is CVE-2026-17500?** Medium severity, with a CVSS score of 5.3, published 27 July 2026.

**Which products and versions are affected?** GGML Llama.Cpp d006858, e15efe0.

**Is there a fix for CVE-2026-17500?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-17500 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-17500?** Check whether you run GGML Llama.Cpp at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A vulnerability exists in the `_visit_pattern` function within `common/json-schema-to-grammar.cpp` of llama.cpp. The issue stems from improper validation of regex patterns during JSON-Schema to grammar conversion. Specifically, the code calls `seq.back()` without verifying if the vector is empty when handling quantifiers (e.g., *, +, ?, {n,m}) following unsupported regex constructs like lookarounds. Additionally, the `transform()` function lacks a recursion depth limit, leading to potential stack exhaustion. A remote attacker can exploit this by submitting a crafted JSON schema (e.g., via a `response_format` request to a server) to trigger a SIGSEGV or stack overflow, resulting in a process crash. A pull request (#25308) has been proposed to add null checks and nesting limits.

## Affected products

- ggml-org llama.cpp d006858, e15efe0

## Timeline

- 2026-07-03: disclosed: Issue reported on GitHub repository
- 2026-07-04: other: Pull request #25308 submitted to fix the issue
- 2026-07-27: advisory: CVE-2026-17500 published

## References

- [https://github.com/ggml-org/llama.cpp/](https://github.com/ggml-org/llama.cpp/)
- [https://github.com/ggml-org/llama.cpp/issues/25284](https://github.com/ggml-org/llama.cpp/issues/25284)
- [https://github.com/ggml-org/llama.cpp/pull/25308](https://github.com/ggml-org/llama.cpp/pull/25308)
- [https://vuldb.com/cve/CVE-2026-17500](https://vuldb.com/cve/CVE-2026-17500)
- [https://vuldb.com/submit/798503](https://vuldb.com/submit/798503)
- [https://vuldb.com/vuln/383353](https://vuldb.com/vuln/383353)
- [https://vuldb.com/vuln/383353/cti](https://vuldb.com/vuln/383353/cti)

## Related threats

- [llama.cpp integer overflow in gguf_init_from_reader](https://junglewise.ai/threats/cve-2026-116840-llama-cpp-b5854-before-b11275-contains-an-integer-overflow)
- [llama.cpp denial of service via negative top_n in reranking API](https://junglewise.ai/threats/cve-2026-52132-llama-cpp-denial-of-service-via-negative-top-n-in-reranking-api)
- [llama.cpp uncontrolled recursion denial of service in json-schema-to-grammar](https://junglewise.ai/threats/cve-2026-52131-llama-cpp-uncontrolled-recursion-denial-of-service-in-json-schema)
- [llama.cpp uncontrolled recursion in JSON schema converter](https://junglewise.ai/threats/cve-2026-52130-llama-cpp-uncontrolled-recursion-in-json-schema-converter)
- [llama.cpp builds b1886 through b7445 contain a race condition use-after-free vulnerability in the LLaMA-Android JNI…](https://junglewise.ai/threats/cve-2026-70640-llama-cpp-builds-b1886-through-b7445-contain-a-race-condition-use)
