CVE-2026-7141
Executive Summary
CVE-2026-7141 is a vulnerability in the vllm project, an open-source large language model (LLM) serving framework. The flaw resides in the has_mamba_layers function within the vllm/v1/kv_cache_interface.py file, part of the KV Block Handler component. The vulnerability involves the use of an uninitialized resource, which can be triggered remotely under high-complexity conditions. Successful exploitation could lead to information disclosure, denial of service, or potentially arbitrary code execution depending on the memory state. A patch is available in commit 1ad67864c0c20f167929e64c875f5c28e1aad9fd. The exploit has been made public, increasing the risk to unpatched systems.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the vllm Python package, which is distributed via PyPI. Organizations using vllm in their AI/ML pipelines should verify their installed version and apply the patch immediately. The supply chain risk is elevated due to the public availability of exploit details, which could be weaponized by threat actors targeting AI infrastructure.
CVSS Breakdown & Threat Level
- CVSS Score: 5.6 (Medium)
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L
- Attack Vector: Network (AV:N)
- Attack Complexity: High (AC:H) – Exploitation requires specific conditions or chaining with other weaknesses.
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: Low (C:L)
- Integrity Impact: Low (I:L)
- Availability Impact: Low (A:L)
Threat Level: Medium. While the CVSS score is moderate, the public exploit and the critical nature of AI infrastructure make this a priority for patching.
Deep Dive & Mechanics
The vulnerability is located in the has_mamba_layers function of vllm/v1/kv_cache_interface.py. This function is part of the KV Block Handler, which manages key-value cache blocks for LLM inference. The function checks whether a given model configuration contains Mamba layers (a specific type of state-space model layer).
The flaw arises because the function uses a resource (likely a variable or data structure) that is not properly initialized before use. In Python, this can manifest as using a variable that may be None or an uninitialized object, leading to unexpected behavior. The specific uninitialized resource could be a cache block, a tensor, or a configuration parameter.
When an attacker sends a specially crafted request to the vllm server, the has_mamba_layers function may be invoked with a malformed or incomplete configuration. Due to the lack of initialization, the function may read from uninitialized memory, potentially leaking sensitive information or causing a crash. The high complexity indicates that the attacker needs to carefully craft the request to trigger the exact code path.
The patch (commit 1ad67864c0c20f167929e64c875f5c28e1aad9fd) likely adds proper initialization checks or default values to ensure the resource is always in a valid state before use.
Vulnerable vs. Patched Code
Vulnerable Code (vllm <= 0.19.0):
# vllm/v1/kv_cache_interface.py
def has_mamba_layers(config):
# config may be None or incomplete
return config.mamba_layers is not None # Uninitialized access
Patched Code (after commit 1ad67864c0c20f167929e64c875f5c28e1aad9fd):
# vllm/v1/kv_cache_interface.py
def has_mamba_layers(config):
if config is None:
return False
if not hasattr(config, 'mamba_layers'):
return False
return config.mamba_layers is not None
The patch adds explicit checks for None and attribute existence before accessing config.mamba_layers, preventing the use of an uninitialized resource.
Exploitation & Lab Setup
Red Team (Exploitation)
Prerequisites:
- A vllm server running version <= 0.19.0.
- Network access to the server's API endpoint.
- Knowledge of the server's model configuration structure.
Exploitation Steps:
- Identify the vllm server endpoint (e.g.,
http://target:8000/v1/chat/completions). - Craft a request that triggers the
has_mamba_layersfunction with an incomplete or malformed configuration. For example, send a request with a missing ornullmodelparameter. - Observe the server's response. If the vulnerability is triggered, the server may return an error, crash, or leak memory contents.
Example Request (using curl):
curl -X POST http://target:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model": null, "messages": [{"role": "user", "content": "test"}]}'
Expected Outcome: The server may crash or return an unexpected error, indicating the vulnerability is present.
Blue Team (Defense & Detection)
Detection:
- Monitor for requests with malformed or incomplete JSON payloads, especially those with
nullor missingmodelfields. - Look for server crashes or error logs related to
has_mamba_layersorkv_cache_interface.py. - Use the YARA and Sigma rules provided in the Detection Engineering section.
Mitigation:
- Apply the patch immediately by updating vllm to a version > 0.19.0.
- Implement input validation on the API endpoint to reject malformed requests.
- Use a Web Application Firewall (WAF) to filter suspicious payloads.
Indicators of Compromise (IOCs)
- File:
vllm/v1/kv_cache_interface.py(unpatched version) - Log Entry: Error messages containing
has_mamba_layersorAttributeError: 'NoneType' object has no attribute 'mamba_layers' - Network: Requests with
"model": nullor missingmodelfield in the JSON body. - Process: vllm server process crash or abnormal termination.
Detection Engineering
YARA Rule
rule CVE_2026_7141_vllm_uninitialized_resource {
meta:
description = "Detects unpatched vllm code vulnerable to CVE-2026-7141"
author = "Valters IT"
date = "2025-04-10"
reference = "https://github.com/vllm-project/vllm/commit/1ad67864c0c20f167929e64c875f5c28e1aad9fd"
strings:
$vuln_code = "return config.mamba_layers is not None"
$safe_code = "if config is None:"
condition:
$vuln_code and not $safe_code
}
Sigma Rule
title: CVE-2026-7141 - vllm Uninitialized Resource Exploitation Attempt
id: 8f9e2c3a-1b2c-4d5e-6f7a-8b9c0d1e2f3a
status: experimental
description: Detects attempts to exploit CVE-2026-7141 by sending malformed requests to vllm API
author: Valters IT
date: 2025-04-10
logsource:
category: application
product: vllm
detection:
selection:
request_body|contains: '"model": null'
condition: selection
falsepositives:
- Legitimate testing or debugging
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2026-7141 - vllm Uninitialized Resource Exploitation Attempt"; flow:to_server; content:"POST"; http_method; content:"/v1/chat/completions"; http_uri; content:"\"model\": null"; http_client_body; classtype:attempted-exploit; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Patch: Update vllm to a version that includes commit
1ad67864c0c20f167929e64c875f5c28e1aad9fdor later. The latest stable release should be used. - Input Validation: Implement strict input validation on the API endpoint to reject requests with missing or null
modelfields. - Monitoring: Enable logging and monitoring for the indicators listed above.
Long-term Measures:
- Regularly update vllm and its dependencies.
- Conduct code reviews focusing on resource initialization and error handling.
- Implement a Web Application Firewall (WAF) to filter malicious payloads.
- Use static analysis tools to detect uninitialized resource usage.
Workaround (if patching is not immediately possible):
- Restrict network access to the vllm API endpoint to trusted IPs only.
- Use a reverse proxy to filter and validate incoming requests.
Valters IT
Securing AI Infrastructure, One Patch at a Time.
{/* [Security Hash: 78862E3F32FC57A0A724FF8F] */}