{"id":"CVE-2025-25183","aliases":["CVE-2025-25183","GHSA-rm76-4mrf-v9r8","PYSEC-2025-62"],"related":[],"kind":"vulnerability","state":"published","title":"vLLM using built-in hash() from Python 3.12 leads to predictable hash collisions in vLLM prefix cache","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nMaliciously constructed prompts can lead to hash collisions, resulting in prefix cache reuse, which can interfere with subsequent responses and cause unintended behavior.\n\n### Details\n\nvLLM'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.\n\n### Impact\n\nThe 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. \n\n### Solution\n\nWe 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.\n\nUsing 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.\n\nTo 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.\n\n### References\n\n* https://github.com/vllm-project/vllm/pull/12621\n* https://github.com/python/cpython/commit/432117cd1f59c76d97da2eaff55a7d758301dbc7\n* https://github.com/python/cpython/pull/99541","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2025-02-06T20:00:05.000Z","modified":"2026-08-07T08:12:27.666Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:L/A:N","score":2.6,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:L/A:N","score":2.6,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:N/I:L/A:N","score":2.6,"rating":"LOW"}],"cwes":["CWE-354"],"affected":[{"ranges":[{"version":"< 0.7.2","status":"affected"}],"vendor":"vllm-project","product":"vllm","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.7.2"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.7.2"}],"vendor":"vllm","product":"vllm","cpe":"cpe:2.3:a:vllm:vllm:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"432117cd1f59c76d97da2eaff55a7d758301dbc7"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.7.2"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","repo":"https://github.com/python/cpython","source":"pysec"}],"references":[{"url":"https://github.com/vllm-project/vllm/security/advisories/GHSA-rm76-4mrf-v9r8","tags":["advisory","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/vllm-project/vllm/pull/12621","tags":["issue-tracking","report","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/python/cpython/commit/432117cd1f59c76d97da2eaff55a7d758301dbc7","tags":["fix","not-applicable","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-25183","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/python/cpython/pull/99541","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vllm-project/vllm/commit/73b35cca7f3745d07d439c197768b25d88b6ab7f","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/vllm/PYSEC-2025-62.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/vllm-project/vllm","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-02-07T20:33:57.205Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-25183","url":"https://www.cve.org/CVERecord?id=CVE-2025-25183","licence":"CVE Terms of Use","modified":"2025-02-12T20:51:46.402Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rm76-4mrf-v9r8","url":"https://github.com/advisories/GHSA-rm76-4mrf-v9r8","licence":"CC-BY-4.0","modified":"2026-08-07T08:12:27.666Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-25183","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-25183","licence":"Public domain","modified":"2026-06-17T09:00:26.433Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2025-62","url":"https://osv.dev/vulnerability/PYSEC-2025-62","licence":"CC-BY-4.0","modified":"2025-07-01T23:59:49.926Z"}],"updatedAt":"2026-11-25T22:58:53.911Z","epss":{"score":0.00196,"percentile":0.09755,"date":"2026-12-01T12:00:22.000Z"}}