Sep 5, 2026·5 min read·42 visits
A race condition in vLLM's custom embedding loaders allows unauthenticated attackers to bypass PyTorch sparse tensor validation, causing out-of-bounds writes and server crashes via crafted requests.
CVE-2026-73557 details a race condition vulnerability in the vLLM serving framework, arising from the thread-unsafe usage of PyTorch's process-global sparse tensor invariant check manager. When processing concurrent requests with custom prompt or multimodal embeddings, concurrent thread execution can disable global tensor integrity checks. An unauthenticated attacker can leverage this timing window to submit malformed sparse coordinate (COO) tensors containing out-of-bounds indices, causing memory corruption and process crashes (Denial of Service).
The vulnerability CVE-2026-73557 is a race condition in vLLM, a high-throughput and memory-efficient serving engine for Large Language Models (LLMs). This flaw specifically impacts how the system handles custom prompt and multimodal embeddings (such as text, image, or audio) provided directly by the client. These features allow clients to bypass the tokenization stage by sending pre-computed serialized PyTorch tensors.\n\nThe vulnerability lies within the interaction between vLLM's concurrent, asynchronous architecture and PyTorch's process-global state model. By sending concurrent requests with custom embeddings, a remote, unauthenticated attacker can exploit this concurrency model to bypass security validation, forcing the vLLM engine to process unvalidated, malformed coordinate (COO) sparse tensors.\n\nThe vulnerability has been assigned CVE-2026-73557 and GHSA-pr7f-p5mw-fc87. It affects all versions of vLLM from 0.20.2rc0 up to, but not including, 0.26.0. Successful exploitation leads to an out-of-bounds memory write, causing a denial-of-service (DoS) crash of the vLLM serving process.
The root cause of CVE-2026-73557 is the non-thread-safe design of PyTorch's torch.sparse.check_sparse_tensor_invariants() context manager. To remediate a previous vulnerability (CVE-2025-62164), vLLM developers wrapped tensor loading calls with this context manager to enforce coordinate bounds validation on Coordinate (COO) sparse tensors.\n\nWhen PyTorch executes torch.sparse.check_sparse_tensor_invariants(), it alters a process-global validation state flag. Upon entering the context manager (__enter__), the current global validation state (usually False by default) is saved, and the process-global flag is set to True. Upon exiting the context manager (__exit__), the saved state is restored back to the process-global flag.\n\nBecause vLLM processes requests asynchronously and offloads CPU-intensive tensor deserialization tasks to a shared ThreadPoolExecutor via asyncio.gather, multiple threads can enter and exit these validation contexts concurrently. This interleaving creates a race condition. A benign thread exiting its context manager can set the global flag back to False while another concurrent thread is still inside its guarded block, leaving the remaining thread to deserialize a malicious tensor with validation silently disabled.
In the vulnerable version of vLLM, the validation context was applied directly around torch.load calls without any thread synchronization. The following code from vllm/renderers/embed_utils.py demonstrates this vulnerability:\n\npython\n# Vulnerable Implementation in vllm/renderers/embed_utils.py\nwith torch.sparse.check_sparse_tensor_invariants():\n tensor = torch.load(\n BytesIO(pybase64.b64decode(embed, validate=True)),\n weights_only=True,\n map_location=torch.device(\"cpu\"),\n )\n return tensor.to_dense()\n\n\nIn the patched version, a process-wide mutex lock _SPARSE_LOAD_LOCK is introduced in vllm/utils/sparse_utils.py to serialize all validation context manager operations. This ensures that only one thread can modify and execute within the global validation context at any given time:\n\npython\n# Patched Implementation in vllm/utils/sparse_utils.py\nimport contextlib\nimport threading\nimport torch\n\n_SPARSE_LOAD_LOCK = threading.Lock()\n\n@contextlib.contextmanager\ndef check_sparse_tensor_invariants_threadsafe():\n # Enforce mutual exclusion on the global state manipulation\n with _SPARSE_LOAD_LOCK, torch.sparse.check_sparse_tensor_invariants():\n yield\n\n\nThis synchronized wrapper is then used across all affected loader paths, including vllm/renderers/embed_utils.py, vllm/multimodal/media/audio.py, and vllm/multimodal/media/image.py, preventing concurrent interleaving.
An attacker can exploit this vulnerability by submitting a request containing both valid and malicious prompt embeddings concurrently, or by sending multiple rapid concurrent requests to the vLLM endpoint. The goal is to trigger the race condition where the exit of a benign load operation disables validation for the concurrent malicious load operation.\n\nThe malicious payload consists of a serialized PyTorch sparse COO tensor containing out-of-bounds indices. Below is an example of constructing such an invalid tensor:\n\npython\nimport io\nimport torch\nimport pybase64\n\n# Create an invalid COO sparse tensor with out-of-bounds indices\nindices = torch.tensor([[999999], [999999]])\nvalues = torch.tensor([1.0])\nshape = (5, 5)\n\ninvalid_sparse = torch.sparse_coo_tensor(\n indices, values, shape, dtype=torch.float32, check_invariants=False\n)\n\nbuf = io.BytesIO()\ntorch.save(invalid_sparse, buf)\nbuf.seek(0)\nmalicious_payload = pybase64.b64encode(buf.read()).decode(\"utf-8\")\n\n\nWhen the race condition is successfully triggered, the global validation flag is set to False before the malicious tensor calls .to_dense(). The compiled PyTorch C++ backend then attempts to write values to memory locations outside the allocated tensor buffer, leading to a segmentation fault and a denial-of-service (DoS) crash.
The exploitation of CVE-2026-73557 has a low-to-medium direct impact, primarily resulting in a Denial of Service (DoS) of the serving engine. When the invalid tensor coordinates are processed without validation, PyTorch's underlying C++ memory management routines perform out-of-bounds memory writes, causing an immediate segmentation fault (SIGSEGV) or heap corruption that terminates the vLLM daemon process.\n\nBecause vLLM serves as the primary inference backbone in production deployments, crashing the daemon disrupts LLM-powered applications and services. While there is no known vector for arbitrary code execution (ACE) or data exfiltration directly from this bug, service instability represents a significant risk for enterprise operations.\n\nThe CVSS v4.0 score is assessed at 6.3 (Medium), with a vector of CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N. The low exploitability probability (EPSS score of 0.00251) and the requirement of concurrent timing states mean that while the vulnerability is serious, widespread exploitation in the wild remains complex and low-priority.
The primary remediation for CVE-2026-73557 is upgrading to vLLM version 0.26.0 or higher. This version implements the thread-safe context manager, which completely closes the race condition window by synchronizing access to PyTorch's global validation configuration.\n\nIf an immediate upgrade is not feasible, organizations should reduce the attack surface by disabling untrusted prompt and multimodal embedding features. This can be achieved by ensuring that the vLLM server is not started with the following command-line flags:\n- --enable-prompt-embeds\n- --enable-mm-embeds\n\nAdditionally, implementing network-level protections can mitigate risk. Employing Web Application Firewalls (WAF) to inspect incoming request bodies for JSON structures containing \"type\": \"prompt_embeds\" or limiting the concurrent rate of API calls to the completion endpoints can disrupt an attacker's ability to successfully execute the race timing loop.
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
vLLM vLLM Project | >= 0.20.2rc0, < 0.26.0 | 0.26.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-362 |
| Attack Vector | Network |
| CVSS v4.0 Score | 6.3 (Medium) |
| EPSS Score | 0.00251 |
| Impact | Denial of Service (Process Crash) |
| Exploit Status | Proof-of-Concept |
| KEV Status | Not Listed |
The program associates a process-global state change with a concurrent validation logic that can be scheduled out-of-order, causing the security control to be disabled while a concurrent execution thread processes invalid input.
CVE-2026-126297 (GHSA-v8f3-6phw-6mh9) is an uncontrolled resource consumption and algorithmic complexity vulnerability in the Natural Language Toolkit (NLTK) prior to version 3.10.4. Located in the Semantic Role Labeling (SRL) parser within `nltk/corpus/reader/conll.py`, the flaw allows an attacker to trigger quadratic O(N^2) CPU processing overhead by providing crafted CoNLL-formatted corpus inputs containing decoy span columns or nested full-width verb spans. Applications parsing untrusted linguistic corpora can experience prolonged CPU exhaustion and application-level Denial of Service (DoS).
CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.
An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.
CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.
CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.
The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.