CVE-2026-54235
vLLM: Improper temperature validation allows NaN/Inf values to crash workers.
- CVSS 6.9
- CWE-1287
- Input Validation and Sanitization
- Remote
vLLM is an inference and serving engine for large language models (LLMs). Prior to 0.23.1rc0, ll temperature validation gates use comparison operators (<, >), which silently evaluate to False for NaN and for positive Infinity in Python's IEEE 754 float semantics. Both values pass every guard and propagate to GPU sampling kernels, where they produce undefined behavior or CUDA errors that can crash the inference worker. This vulnerability is fixed in 0.23.1rc0.
- CWE
- CWE-1287
- CVSS base score
- 6.9
- Published
- 2026-06-22
- OWASP
- A08 Software and Data Integrity Failures
- Orthogonal defect classification
- Checking
- Code defect classification
- Incorrect Check
- Category
- Input Validation and Sanitization
- Subcategory
- Arithmetic Errors
- Accessibility scope
- Remote
- Impact
- Denial of Service (DoS)
- Affected component
- vLLM
- Fixed by upgrading
- Yes
Solution
Upgrade vLLM to version 0.23.1rc0 or later.
Vulnerable code sample
class SamplingParams:
def __init__(self, temperature: float):
self.temperature = temperature
self._verify_args()
def _verify_args(self):
if self.temperature < 0.0:
raise ValueError(
f"Temperature must be non-negative, but is {self.temperature}.")
# The vulnerable code allows `float('nan')` and `float('inf')` to pass
# this check because the comparison `self.temperature < 0.0` evaluates
# to False for these values.Patched code sample
def _validate_temperature(temperature: float):
"""
Validates temperature, rejecting negative values and non-finite numbers
like NaN, which passed the vulnerable checks.
"""
# The vulnerable check was `if temperature < 0.0:`. This is bypassed by
# NaN because `float('nan') < 0.0` evaluates to False.
#
# The fixed logic uses a negated comparison. For a NaN input,
# `temperature >= 0.0` evaluates to False. The `not` operator inverts
# this to True, correctly triggering the validation error.
if not (temperature >= 0.0):
raise ValueError(
f"temperature must be non-negative, got {temperature}")
def _validate_top_p(top_p: float):
"""
Validates top_p, rejecting values outside (0, 1] and non-finite numbers.
"""
# The vulnerable check might have been `if top_p <= 0.0 or top_p > 1.0:`.
# This is also bypassed by NaN.
#
# The fix uses a chained comparison. For a NaN input, the entire
# expression `0.0 < top_p <= 1.0` is False, causing `not False` to
# become True and trigger the error. This also rejects infinity.
if not (0.0 < top_p <= 1.0):
raise ValueError(
f"top_p must be in (0, 1], got {top_p}")Payload
{
"prompt": "Explain the vulnerability CVE-2026-54235 in simple terms.",
"temperature": float('nan'),
"max_tokens": 100
}
Cite this entry
@misc{vaitp:cve202654235,
title = {{vLLM: Improper temperature validation allows NaN/Inf values to crash workers.}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2026},
note = {VAITP Python Vulnerability Dataset, entry CVE-2026-54235},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2026-54235/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
