# CVE-2025-61620: vLLM: Resource-Exhaustion (DoS) through Malicious Jinja Template in OpenAI-Compatible Server

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **CWE:** CWE-20, CWE-400, CWE-770
- **Aliases:** GHSA-6fvq-23cw-5628, PYSEC-2026-2013
- **Published:** 2025-10-07T21:35:22.000Z
- **Modified:** 2026-09-10T03:50:29.476Z

## Who should check

- Projects that depend on PyPI package vllm (\>= 0.5.1, \< 0.11.0)

## Description

\#\#\# 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

## Affected and fixed versions

- PyPI `vllm`: affected \>= 0.5.1, \< 0.11.0; fixed 0.11.0 (osv)

## Mitigation

- Upgrade vllm to 0.11.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2025-61620. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-61620.md
Affected: vllm >= 0.5.1, < 0.11.0
Fixed in: 0.11.0

Steps:
1. Search this machine and project for vllm (PyPI): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2025-61620 being exploited?

There is no confirmed exploitation: CVE-2025-61620 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2025-61620?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2025-61620?

vllm \>= 0.5.1, \< 0.11.0.

### Is there a fix for CVE-2025-61620?

Yes. Fixed in 0.11.0. Upgrade vllm to 0.11.0 or later.

### How do I check if I'm affected by CVE-2025-61620?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/vllm-project/vllm/security/advisories/GHSA-6fvq-23cw-5628>
- vendor: <https://github.com/advisories/GHSA-6fvq-23cw-5628>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2025-61620>
- patch: <https://github.com/vllm-project/vllm/pull/25794>
- patch: <https://github.com/vllm-project/vllm/commit/7977e5027c2250a4abc1f474c5619c40b4e5682f>
- other: <https://github.com/vllm-project/vllm>
- other: <https://pypi.org/project/vllm>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-6fvq-23cw-5628> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-2013> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2025-61620> · JSON: <https://flawdb.com/api/v1/entries/CVE-2025-61620>
