CVE-2025-61620 json
vLLM: Resource-Exhaustion (DoS) through Malicious Jinja Template in OpenAI-Compatible Server
published 2025-10-07 13 mo ago modified 2026-09-10 1 mo ago also GHSA-6fvq-23cw-5628 , PYSEC-2026-2013
- cvss
- 6.5
- version 3.1, GitHub
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- —
- no EPSS score yet
- public exploits
- 0
- none known
Summary
### Summary
A resource-exhaustion (denial-of-service) vulnerability exists in multiple endpoints of the OpenAI-Compatible Server due to the ability to specify Jinja templates via the `chat_template` and `chat_template_kwargs` parameters. If an attacker can supply these parameters to the API, they can cause a service outage by exhausting CPU and/or memory resources.
### Details
When using an LLM as a chat model, the conversation history must be rendered into a text input for the model. In `hf/transformer`, this rendering is performed using a Jinja template. The OpenAI-Compatible Server launched by vllm serve exposes a `chat_template` parameter that lets users specify that template. In addition, the server accepts a `chat_template_kwargs` parameter to pass extra keyword arguments to the rendering function.
Because Jinja templates support programming-language-like constructs (loops, nested iterations, etc.), a crafted template can consume extremely large amounts of CPU and memory and thereby trigger a denial-of-service condition.
Importantly, simply forbidding the `chat_template` parameter does not fully mitigate the issue. The implementation constructs a dictionary of keyword arguments for `apply_hf_chat_template` and then updates that dictionary with the user-supplied `chat_template_kwargs` via `dict.update`. Since `dict.update` can overwrite existing keys, an attacker can place a `chat_template` key inside `chat_template_kwargs` to replace the template that will be used by `apply_hf_chat_template`.
```python # vllm/entrypoints/openai/serving_engine.py#L794-L816 _chat_template_kwargs: dict[str, Any] = dict( chat_template=chat_template, add_generation_prompt=add_generation_prompt, continue_final_message=continue_final_message, tools=tool_dicts, documents=documents, ) _chat_template_kwargs.update(chat_template_kwargs or {})
request_prompt: Union[str, list[int]] if isinstance(tokenizer, MistralTokenizer): ... else: request_prompt = apply_hf_chat_template( tokenizer=tokenizer, conversation=conversation, model_config=model_config, **_chat_template_kwargs, ) ```
### Impact
If an OpenAI-Compatible Server exposes endpoints that accept `chat_template` or `chat_template_kwargs` from untrusted clients, an attacker can submit a malicious Jinja template (directly or by overriding `chat_template` inside `chat_template_kwargs`) that consumes excessive CPU and/or memory. This can result in a resource-exhaustion denial-of-service that renders the server unresponsive to legitimate requests.
### Fixes
* https://github.com/vllm-project/vllm/pull/25794
Patch / fix
- pypi vllm 0.11.0
- github.com/vllm-project/vllm@7977e50 commit
- github.com/vllm-project/vllm#25794 pull request
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2025-61620 updated cvss 6.5
vllm: vLLM OpenAI-Compatible Server Resource Exhaustion via chat_template Parameters
-
Red Hat AI Inference Server rhaiis/vllm-tpu-rhel9, rhaiis/vllm-spyre-rhel9 Red Hat Enterprise Linux AI (RHEL AI) rhelai1/bootc-amd-rhel9, rhelai1/bootc-intel-rhel9, rhelai1/bootc-nvidia-rhel9, rhelai1/bootc-azure-amd-rhel9, rhelai1/instructlab-amd-rhel9, rhelai1/bootc-aws-nvidia-rhel9, +4 more Red Hat OpenShift AI (RHOAI) rhoai/odh-kserve-agent-rhel9, rhoai/odh-kserve-router-rhel9, rhoai/odh-kserve-controller-rhel9, rhoai/odh-kserve-storage-initializer-rhel9, rhoai/odh-pipeline-runtime-minimal-cpu-py311-rhel9, rhoai/odh-pipeline-runtime-minimal-cpu-py312-rhel9, +28 moreaffected: workaround, no fix available “Fix deferred”
-
Red Hat AI Inference Server 3.2 rhaiis 1772160593, rhaiis 1772160625fixed: vendor fix RHSA-2026:3461
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| OSV | 3.1 | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 3.1 | 6.5 | CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | vllm | >=0.5.1, <0.11.0 |
0.11.0 |
Classification
References
-
github.com
/vllm-project/vllm/pull/25794
web
-
github.com
/vllm-project/vllm/commit/7977e5027c2250a4abc1f474c5619c40b4e5682f
web
-
github.com
/vllm-project/vllm/security/advisories/GHSA-6fvq-23cw-5628
web
-
github.com
/vllm-project/vllm
package
-
pypi.org
/project/vllm
package
-
github.com
/advisories/GHSA-6fvq-23cw-5628
advisory
-
nvd.nist.gov
/vuln/detail/CVE-2025-61620
advisory
Sources
- GitHub Advisory GHSA-6fvq-23cw-5628
- OSV PYSEC-2026-2013
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.