vLLM CVE-2026-41523
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPublish malicious HuggingFace model
-
DeliveryVictim loads model under python -O
-
ExploitPooler reads attacker activation_fn string
-
ExecutionStripped assert skips allowlist check
-
Persistresolve_obj_by_qualname imports attacker module
-
ImpactArbitrary code executes as vLLM process
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires three concrete preconditions, all explicitly stated in the advisory: (1) the vLLM Python process must be launched with optimization enabled - either 'python -O' or PYTHONOPTIMIZE=1 in the environment - so the assert-based allowlist is removed at compile time; (2) the victim must load an attacker-controlled HuggingFace model whose config.json populates either sentence_transformers.activation_fn or sbert_ce_default_activation_function (user-interaction step, matching CVSS UI:R); and (3) the model must use a cross-encoder architecture (e.g. BERT or RoBERTa with sequence classification) so that get_act_fn() is reached via resolve_classifier_act_fn() in SequencePooler or TokenPooler. Limiting factors: default Python execution (no -O) still enforces the assert and is not exploitable, models using standard generative architectures do not exercise the vulnerable pooler path, and operators that load only vetted/local models are not exposed even when -O is set. |
| Impact | The vendor-issued CVSS 3.1 score of 7.5 with vector AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H captures the trade-off well: the impact is full arbitrary code execution as the vLLM process (C:H/I:H/A:H), but AC:H, UI:R and the requirement that the target process be started with -O/PYTHONOPTIMIZE=1 plus loading a cross-encoder architecture mean exploitation is not a one-shot internet-wide bug. No EPSS score, KEV listing, or public PoC is included in the input, so this should be treated as 'no public exploit identified at time of analysis' rather than active exploitation. Real-world risk concentrates in environments that (a) run vLLM under PYTHONOPTIMIZE for performance, which the reporter notes is documented in production use, and (b) load models from untrusted HuggingFace authors or any pipeline that auto-pulls third-party models - in those settings this is effectively pre-auth RCE through the model supply chain and should be treated as high priority. For deployments that pin to vetted internal models and do not use -O, the practical exposure is materially lower, though the systemic warning that resolve_obj_by_qualname is called from ~20 sites without input validation argues for prompt patching regardless. |
| Exploit ScenarioDerived | An attacker publishes a HuggingFace cross-encoder model whose config.json sets sentence_transformers.activation_fn (or sbert_ce_default_activation_function) to a fully qualified Python name outside torch.nn.modules - for example, a module whose import side effect spawns a reverse shell. A victim operator running vLLM under python -O (or PYTHONOPTIMIZE=1) loads the model by name; during pooler initialization the stripped assert no longer enforces the allowlist, and resolve_obj_by_qualname() imports the attacker's module and calls getattr() on it, executing arbitrary code in the vLLM process. No public exploit is identified at time of analysis, but the patch diff and detailed advisory make a working proof-of-concept straightforward to construct. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 16, 2026
Arbitrary code execution in vLLM versions prior to 0.22.0 allows remote unauthenticated attackers to run code on the inference server by publishing a malicious HuggingFace model, when vLLM is launched in Python optimized mode (python -O or PYTHONOPTIMIZE=1). The sole guardrail restricting which activation function classes can be loaded from a model's config.json is implemented with a Python assert, which is stripped at compile time under -O, leaving an unrestricted import gadget directly fed by attacker-controlled data. No public exploit identified at time of analysis, but the vendor advisory (GHSA-q8gq-377p-jq3r) and a coordinated huntr.com submission document the issue in detail.
RemediationAI
Vendor-released patch: upgrade vLLM to 0.22.0 or later, which replaces the assert with an explicit 'if not function_name.startswith("torch.nn.modules."): raise ValueError(...)' in vllm/model_executor/layers/pooler/activations.py (commit b3c7ffcab82c2439726f8cb213800f6f38c023d3, advisory https://github.com/vllm-project/vllm/security/advisories/GHSA-q8gq-377p-jq3r). If you cannot upgrade immediately, the simplest compensating control is to stop running vLLM under python -O or with PYTHONOPTIMIZE=1 - this restores the assert and closes the vulnerable code path, at the cost of slightly larger memory footprint and losing the marginal CPU savings from stripped asserts and __debug__ branches. As a model-supply-chain control, restrict which HuggingFace repositories vLLM is allowed to load (pin to specific vetted revisions or mirror them to an internal registry) and forbid auto-pulling models from arbitrary external authors; this is high-value but introduces operational overhead in model curation. Defenders who maintain a fork can also locally backport the conditional-raise change shown in the upstream commit to older vLLM versions.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
vLLM is a high-throughput inference and serving engine for large language models written in Python (pkg:pip/vllm). In vllm/model_executor/layers/pooler/activations.py, the get_act_fn() routine reads an activation_fn / sbert_ce_default_activation_function string from the loaded HuggingFace model config and uses 'assert function_name.startswith("torch.nn.modules.")' as its only allowlist before passing the value to resolve_obj_by_qualname(), which performs importlib.import_module() followed by getattr() with no further validation. Python documents that assert is removed when the interpreter runs with -O or PYTHONOPTIMIZE=1, so the allowlist disappears in exactly the production-tuned configurations vLLM operators are likely to use. The root cause is CWE-94 (Improper Control of Generation of Code) realized through an assert-based security check, the same class CISA and Bandit (B101) / Ruff (S101) flag and the reason Django removed assert-based checks in ticket #32508; CVE-2017-1000433 in pysaml2 is a direct prior analogue. The reachable call sites are SequencePooler (vllm/model_executor/layers/pooler/seqwise/poolers.py:122) and TokenPooler (tokwise/poolers.py:130), invoked when loading cross-encoder / sentence-transformer models (e.g. BERT or RoBERTa for sequence classification).
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
Attacker is a remote unauthenticated model publisher (AV:N/PR:N) but victim must load the model and run vLLM under -O (UI:R, AC:H); successful exploit yields full process compromise (C:H/I:H/A:H).
Primary rating from Vendor (https://github.com/vllm-project/vllm).
CVSS VectorVendor: https://github.com/vllm-project/vllm
DescriptionCVE.org
Summary
An assert-based security check in vLLM's activation function loading allows any unauthenticated attacker to achieve arbitrary code execution on the server by publishing a malicious HuggingFace model, when vLLM runs in Python optimized mode (python -O or PYTHONOPTIMIZE=1).
Details
vLLM uses an assert statement at vllm/model_executor/layers/pooler/activations.py:48 as its sole security control to restrict which activation functions can be loaded from a HuggingFace model's config.json:
# vllm/model_executor/layers/pooler/activations.py:35-53
function_name: str | None = None
if (
hasattr(config, "sentence_transformers")
and "activation_fn" in config.sentence_transformers
):
function_name = config.sentence_transformers["activation_fn"]
elif (
hasattr(config, "sbert_ce_default_activation_function")
and config.sbert_ce_default_activation_function is not None
):
function_name = config.sbert_ce_default_activation_function
if function_name is not None:
assert function_name.startswith("torch.nn.modules."), (
"Loading of activation functions is restricted to "
"torch.nn.modules for security reasons"
)
fn = resolve_obj_by_qualname(function_name)()Python's assert statements are stripped at compile time when running in optimized mode (python -O or PYTHONOPTIMIZE=1). When the assert is absent, the attacker-controlled function_name from the model's config.json is passed directly to resolve_obj_by_qualname() - an unrestricted import gadget:
def resolve_obj_by_qualname(qualname: str) -> Any:
module_name, obj_name = qualname.rsplit(".", 1)
module = importlib.import_module(module_name)
return getattr(module, obj_name)This is the same vulnerability class as CVE-2017-1000433 (pysaml2 assert-based auth bypass), flagged by Bandit B101 and Ruff S101, and the reason Django proactively replaced all assert-based security checks (ticket #32508).
Attacker-controlled input sources:
config.sentence_transformers["activation_fn"](line 40)config.sbert_ce_default_activation_function(line 45)
Affected call sites - get_act_fn() is called via resolve_classifier_act_fn() from:
vllm/model_executor/layers/pooler/seqwise/poolers.py:122- SequencePoolervllm/model_executor/layers/pooler/tokwise/poolers.py:130- TokenPooler
Broader systemic risk: resolve_obj_by_qualname is called from ~20 locations across the codebase with no validation of its own. Any future caller feeding user-controlled input to it without validation creates the same vulnerability class.
Suggested fix: Replace the assert with an explicit conditional raise:
if not function_name.startswith("torch.nn.modules."):
raise ValueError(
"Loading of activation functions is restricted to "
"torch.nn.modules for security reasons"
)Impact
Arbitrary code execution. A malicious model author publishes a HuggingFace model with a crafted config.json. When a victim loads this model with vLLM running under python -O or PYTHONOPTIMIZE=1, arbitrary code executes during model initialization with the privileges of the vLLM process.
The attack requires:
- Victim loads a malicious model from HuggingFace (user interaction)
- vLLM runs under
python -OorPYTHONOPTIMIZE=1(documented in production use) - Model uses a cross-encoder architecture (e.g. BERT or RoBERTa with sequence classification)
Coordinated disclosure note: This vulnerability was also reported via huntr.com on April 2, 2026 (https://huntr.com/bounties/dcb05b04-e625-41e7-adbc-bbae0cc2d64c). A GitHub Security Advisory was also filed because it is vLLM's stated preferred disclosure channel per SECURITY.md.
Fix
A fix for this was introduced in this commit: https://github.com/vllm-project/vllm/commit/b3c7ffcab82c2439726f8cb213800f6f38c023d3
Blast Radius
ecosystem impact- 1 pypi packages depend on vllm (1 direct, 0 indirect)
Ecosystem-wide dependent count for version 0.22.0.
Articles & Coverage 1
Executive ViewAI
vLLM versions prior to 0.22.0 contain a critical vulnerability allowing remote attackers to execute arbitrary code on inference servers without authentication. Organizations deploying vLLM in Python optimized mode face immediate risk of complete system compromise through malicious AI model downloads. This affects any enterprise using open-source LLM inference, particularly those processing untrusted models from community repositories.
Apply vendor patch: vLLM 0.22.0+. If patching is delayed: (1) disable Python optimized mode to restore the assert-based protection; (2) restrict outbound downloads to approved internal model registries; (3) implement runtime execution monitoring on inference servers.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Affected Products (CPE)CVE.org
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
GHSA-q8gq-377p-jq3r
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB