CVE-2025-25183
JSON

2.6low

vLLM using built-in hash() from Python 3.12 leads to predictable hash collisions in vLLM prefix cache

Severity
2.6low CVSS:3.1 by GitHub_M
Exploit likelihood
0.20% (higher than 9% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-rm76-4mrf-v9r8PYSEC-2025-62

Description

vLLM is a high-throughput and memory-efficient inference and serving engine for LLMs. Maliciously constructed statements can lead to hash collisions, resulting in cache reuse, which can interfere with subsequent responses and cause unintended behavior. Prefix caching makes use of Python's built-in hash() function. As of Python 3.12, the behavior of hash(None) has changed to be a predictable constant value. This makes it more feasible that someone could try exploit hash collisions. The impact of a collision would be using cache that was generated using different content. Given knowledge of prompts in use and predictable hashing behavior, someone could intentionally populate the cache using a prompt known to collide with another prompt in use. This issue has been addressed in version 0.7.2 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
vllm-project vllm< 0.7.2CVE List
vllm (PyPI)before 0.7.2, before 432117cd1f59c76d97da2eaff55a7d758301dbc7GitHub Advisory Database, PyPA Advisory Database
vllm vllmbefore 0.7.2NVD

All scores

GitHub_M2.6low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:L/A:N
GitHub2.6low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:L/A:N

Classification

CWE-354

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

vLLM is a high-throughput and memory-efficient inference and serving engine for LLMs. Maliciously constructed statements can lead to hash collisions, resulting in cache reuse, which can interfere with subsequent responses and cause unintended behavior. Prefix caching makes use of Python's built-in hash() function. As of Python 3.12, the behavior of hash(None) has changed to be a predictable constant value. This makes it more feasible that someone could try exploit hash collisions. The impact of a collision would be using cache that was generated using different content. Given knowledge of prompts in use and predictable hashing behavior, someone could intentionally populate the cache using a prompt known to collide with another prompt in use. This issue has been addressed in version 0.7.2 and all users are advised to upgrade. There are no known workarounds for this vulnerability.

GitHub Advisory Database
Summary

Maliciously constructed prompts can lead to hash collisions, resulting in prefix cache reuse, which can interfere with subsequent responses and cause unintended behavior.

Details

vLLM's prefix caching makes use of Python's built-in hash() function. As of Python 3.12, the behavior of hash(None) has changed to be a predictable constant value. This makes it more feasible that someone could try exploit hash collisions.

Impact

The impact of a collision would be using cache that was generated using different content. Given knowledge of prompts in use and predictable hashing behavior, someone could intentionally populate the cache using a prompt known to collide with another prompt in use.

Solution

We address this problem by initializing hashes in vllm with a value that is no longer constant and predictable. It will be different each time vllm runs. This restores behavior we got in Python versions prior to 3.12.

Using a hashing algorithm that is less prone to collision (like sha256, for example) would be the best way to avoid the possibility of a collision. However, it would have an impact to both performance and memory footprint. Hash collisions may still occur, though they are no longer straight forward to predict.

To give an idea of the likelihood of a collision, for randomly generated hash values (assuming the hash generation built into Python is uniformly distributed), with a cache capacity of 50,000 messages and an average prompt length of 300, a collision will occur on average once every 1 trillion requests.

References
NVD (es)

vLLM es un motor de inferencia y servicio de alto rendimiento y uso eficiente de la memoria para LLM. Las declaraciones construidas de forma malintencionada pueden provocar colisiones de hash, lo que da como resultado la reutilización de la memoria caché, lo que puede interferir con las respuestas posteriores y provocar un comportamiento no deseado. El almacenamiento en caché de prefijos utiliza la función hash() incorporada de Python. A partir de Python 3.12, el comportamiento de hash(None) ha cambiado para ser un valor constante predecible. Esto hace que sea más factible que alguien pueda intentar explotar las colisiones de hash. El impacto de una colisión sería el uso de la memoria caché generada con un contenido diferente. Dado el conocimiento de los mensajes en uso y el comportamiento predecible del hash, alguien podría rellenar intencionalmente la memoria caché utilizando un mensaje que se sabe que colisiona con otro mensaje en uso. Este problema se ha solucionado en la versión 0.7.2 y se recomienda a todos los usuarios que actualicen. No existen workarounds para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-25183 changed 2025-02-12CVE Terms of Use
GitHub Advisory DatabaseGHSA-rm76-4mrf-v9r8 changed 2026-08-07CC-BY-4.0
NVDCVE-2025-25183 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2025-62 changed 2025-07-01CC-BY-4.0