CVE-2026-41523
JSON

7.5high

vLLM: Security Check Bypass via assert Statement in Activation Function Loading Allows Arbitrary Code Execution

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.61% (higher than 50% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-q8gq-377p-jq3rPYSEC-2026-2300

Description

vLLM is an inference and serving engine for large language models (LLMs). Prior to 0.22.0, 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). This vulnerability is fixed in 0.22.0.

Affected

Product or packageVersionsReported by
vllm-project vllm< 0.22.0CVE List
rhaiis/vllm-cuda-rhel9Not specified
Not affected: from 1782951012 before *, from 1787860580 before *, from 1787161382 before *
CVE List
rhaiis/vllm-rocm-rhel9Not specified
Not affected: from 1782951244 before *, from 1787884873 before *, from 1787161803 before *
CVE List
rhaii/vllm-cpu-rhel9Not specified
Not affected: from 1787151769 before *
CVE List
rhaii/vllm-spyre-rhel9Not specified
Not affected: from 1787151840 before *
CVE List
rhaii/vllm-cuda-rhel9Not specified
Not affected: from 1787151771 before *
CVE List
rhaii/vllm-rocm-rhel9Not specified
Not affected: from 1787151774 before *
CVE List
rhelai3/disk-image-cuda-rhel9Not specified
Not affected: from 1788290314 before *, from 1787310717 before *
CVE List
rhelai3/bootc-aws-cuda-rhel9Not specified
Not affected: from 1788273908 before *, from 1787253912 before *
CVE List
rhelai3/bootc-azure-cuda-rhel9Not specified
Not affected: from 1788273909 before *, from 1787253989 before *
CVE List
rhelai3/bootc-azure-rocm-rhel9Not specified
Not affected: from 1788273908 before *, from 1787254059 before *
CVE List
rhelai3/bootc-cuda-rhel9Not specified
Not affected: from 1788260684 before *, from 1787243961 before *
CVE List

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
redhat-SADP7.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
PyPA Advisory Database7.5high CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H

Classification

CWE-94CWE-617

SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.

What each source says

CVE List

vLLM is an inference and serving engine for large language models (LLMs). Prior to 0.22.0, 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). This vulnerability is fixed in 0.22.0.

GitHub Advisory Database
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 — SequencePooler
  • vllm/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:

  1. Victim loads a malicious model from HuggingFace (user interaction)
  2. vLLM runs under python -O or PYTHONOPTIMIZE=1 (documented in production use)
  3. 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

NVD (es)

vLLM es un motor de inferencia y servicio para modelos de lenguaje grandes (LLM). Antes de la 0.22.0, una comprobación de seguridad basada en assert en la carga de funciones de activación de vLLM permite a cualquier atacante no autenticado lograr la ejecución de código arbitrario en el servidor al publicar un modelo malicioso de HuggingFace, cuando vLLM se ejecuta en modo optimizado de Python (python -O o PYTHONOPTIMIZE=1). Esta vulnerabilidad se corrige en la 0.22.0.

References

https://github.com/vllm-project/vllm/security/advisories/GHSA-q8gq-377p-jq3revidence, exploit, third-party-advisory, web
https://github.com/vllm-project/vllm/commit/b3c7ffcab82c2439726f8cb213800f6f38c023d3fix, patch, web
https://huntr.com/bounties/dcb05b04-e625-41e7-adbc-bbae0cc2d64cadvisory, third-party-advisory, web
https://access.redhat.com/security/cve/CVE-2026-41523vdb-entry, web
https://bugzilla.redhat.com/show_bug.cgi?id=2491582issue-tracking, report, web
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41523.jsonweb
https://access.redhat.com/errata/RHSA-2026:61627vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:36005advisory, vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:61629vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:36006advisory, vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:59138vendor-advisory, web
https://access.redhat.com/errata/RHSA-2026:59139vendor-advisory, web

Sources

SourceRecordLicence
CVE ListCVE-2026-41523 changed 2026-09-04CVE Terms of Use
GitHub Advisory DatabaseGHSA-q8gq-377p-jq3r changed 2026-09-10CC-BY-4.0
NVDCVE-2026-41523 changed 2026-10-25Public domain
PyPA Advisory DatabasePYSEC-2026-2300 changed 2026-07-13CC-BY-4.0