/

CVE-2026-56340

Severity:

HIGH RISK

(8.8)

Input Validation Flaw (CWE-20) in vLLM Sparse Embeddings

CVE-2026-56340

Modified

Vulnerability type

Category:

Improper Input Validation

CWE:

CWE-20, CWE-787

Impact:

Denial of Service and Potential Memory Corruption

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

vLLM's multimodal embeddings processing lacks proper validation of sparse tensor indices when the prompt-embeds feature is enabled, allowing malformed inputs to bypass expected invariants.

Attackers who can send crafted embedding requests may cause crashes, resource exhaustion, or memory corruption conditions that manifest as denial of service in the serving process.

Affected context

This vulnerability affects vLLM deployments running versions 0.10.2 through 0.12.x where the prompt-embeds feature is enabled for multimodal or custom embedding workflows.

It is most relevant in environments where untrusted or semi-trusted clients can submit embedding or generation requests that include sparse tensors or low-level embedding structures.

Because PyTorch disables sparse tensor invariant checks by default, the underlying runtime does not reject malformed indices, leaving the vLLM server responsible for enforcing correctness and bounds.

Exploit preconditions

  • Attack surface: vLLM API endpoints that accept prompt embeddings or multimodal embedding payloads, especially when exposed over the network.
  • Required access: Ability to submit crafted requests to the vLLM service (e.g., API client, tenant in a shared LLM service, or compromised upstream application).
  • Trigger point: Processing of sparse tensor data in the prompt-embeds path, where indices are negative, out-of-bounds, or otherwise malformed.
  • Why exploitation is possible: The embeddings handling logic assumes incoming sparse indices are well-formed and does not enforce invariants or bounds checks, while PyTorch's disabled invariant checks fail to provide a safety net, allowing invalid indices to reach low-level operations.

Why this happens

The root cause is a lack of robust input validation on sparse tensor indices within the prompt-embeds code path in vLLM.

The implementation implicitly trusts that caller-provided indices are valid and consistent with the tensor dimensions, and does not enforce range, uniqueness, or structural constraints before handing them off to PyTorch.

Under CWE-20 (Improper Input Validation), this pattern emerges when complex structured inputs (here, sparse tensors used for multimodal embeddings) are accepted without thorough syntactic and semantic checking, leading to undefined behavior such as out-of-bounds access, write-what-where scenarios, and crash-prone code paths.

Potential impact

  • vLLM server crashes caused by invalid sparse tensor operations, resulting in denial of service.
  • Resource exhaustion from pathological tensor shapes or index patterns that consume excessive CPU or memory.
  • Out-of-bounds read/write conditions in low-level tensor routines, with potential memory corruption.
  • Disruption of multi-tenant LLM services that rely on a shared vLLM backend, impacting availability for multiple users.
  • Amplified operational risk if the vulnerable endpoint is part of an automated pipeline or critical application workflow.

General mitigation guidance

Effective mitigation focuses on enforcing strict validation rules for all embedding-related inputs and minimizing trust in client-supplied tensor shapes and indices.

Common defensive patterns include:

  • Implementing explicit bounds checks and structural validation on sparse indices before constructing or passing tensors to the backend runtime.
  • Normalizing and sanitizing client inputs into an internal, well-defined representation instead of directly forwarding user-controlled tensor metadata.
  • Applying robust schema validation at API boundaries, ensuring that indices, shapes, and sparsity patterns conform to expected constraints.
  • Isolating embedding processing in components with least-privilege and strong memory safety guarantees where possible (e.g., using safer wrappers or language boundaries).
  • Rate-limiting and request-level resource controls to reduce the blast radius of expensive or malformed embedding requests.

How teams detect issues like this

Detection usually combines defensive coding review with runtime monitoring and automated analysis of tensor handling paths.

Potential approaches include:

  • Static analysis or custom linters that flag direct use of user-controlled indices to construct or index tensors without explicit validation.
  • Code review checklists that require validation of tensor shapes, index ranges, and sparsity invariants at API boundaries and before low-level operations.
  • Runtime instrumentation or assertions in debug builds to detect invalid sparse indices, unexpected shapes, or invariant violations during development and testing.
  • Centralized logging and monitoring of error patterns, crashes, and abnormal resource utilization during embedding requests, feeding into alerting and anomaly detection systems.

Sources

SourceLink
github.comgithub.com/vllm-project/vllm/security/advisories/GHSA-mcmc-2m55-j8jj
vulncheck.comvulncheck.com/advisories/vllm-denial-of-service-via-unvalidated-multimodal-embeddings
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-56340
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2491060
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-56340.json

Frequently asked

questions

Yes, if the vLLM service exposes endpoints that accept prompt-embeds or multimodal embedding inputs over the network, a remote client can exploit the flaw by sending specially crafted requests.

An attacker typically needs only the ability to submit requests to the affected vLLM endpoint. This could be a regular API client or tenant in a shared environment; no direct access to the host or container is required.

The safest approach is to introduce comprehensive validation of sparse tensor indices and shapes before they are used, rejecting or normalizing malformed inputs and ensuring that all index operations are provably within bounds.

Adopt a design policy that treats all tensor metadata as untrusted, enforces schema and range checks at API boundaries, and incorporates automated testing and static analysis focused on index safety and resource limits for any new tensor-processing paths.

Find out what's already
exploitable in your codebase.