{"id":"CVE-2026-41523","aliases":["CVE-2026-41523","GHSA-q8gq-377p-jq3r","PYSEC-2026-2300"],"related":[],"kind":"vulnerability","state":"published","title":"vLLM: Security Check Bypass via assert Statement in Activation Function Loading Allows Arbitrary Code Execution","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nAn `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`).\n\n### Details\n\nvLLM uses an `assert` statement at [`vllm/model_executor/layers/pooler/activations.py:48`](https://github.com/vllm-project/vllm/blob/main/vllm/model_executor/layers/pooler/activations.py#L48) as its sole security control to restrict which activation functions can be loaded from a HuggingFace model's `config.json`:\n\n```python\n# vllm/model_executor/layers/pooler/activations.py:35-53\nfunction_name: str | None = None\nif (\n    hasattr(config, \"sentence_transformers\")\n    and \"activation_fn\" in config.sentence_transformers\n):\n    function_name = config.sentence_transformers[\"activation_fn\"]\nelif (\n    hasattr(config, \"sbert_ce_default_activation_function\")\n    and config.sbert_ce_default_activation_function is not None\n):\n    function_name = config.sbert_ce_default_activation_function\n\nif function_name is not None:\n    assert function_name.startswith(\"torch.nn.modules.\"), (\n        \"Loading of activation functions is restricted to \"\n        \"torch.nn.modules for security reasons\"\n    )\n    fn = resolve_obj_by_qualname(function_name)()\n```\n\nPython'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()`](https://github.com/vllm-project/vllm/blob/main/vllm/utils/import_utils.py#L106) — an unrestricted import gadget:\n\n```python\ndef resolve_obj_by_qualname(qualname: str) -> Any:\n    module_name, obj_name = qualname.rsplit(\".\", 1)\n    module = importlib.import_module(module_name)\n    return getattr(module, obj_name)\n```\n\nThis 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).\n\n**Attacker-controlled input sources:**\n- `config.sentence_transformers[\"activation_fn\"]` (line 40)\n- `config.sbert_ce_default_activation_function` (line 45)\n\n**Affected call sites** — `get_act_fn()` is called via `resolve_classifier_act_fn()` from:\n- `vllm/model_executor/layers/pooler/seqwise/poolers.py:122` — SequencePooler\n- `vllm/model_executor/layers/pooler/tokwise/poolers.py:130` — TokenPooler\n\n**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.\n\n**Suggested fix:** Replace the `assert` with an explicit conditional raise:\n\n```python\nif not function_name.startswith(\"torch.nn.modules.\"):\n    raise ValueError(\n        \"Loading of activation functions is restricted to \"\n        \"torch.nn.modules for security reasons\"\n    )\n```\n\n### Impact\n\n**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.\n\nThe attack requires:\n1. Victim loads a malicious model from HuggingFace (user interaction)\n2. vLLM runs under `python -O` or `PYTHONOPTIMIZE=1` (documented in production use)\n3. Model uses a cross-encoder architecture (e.g. BERT or RoBERTa with sequence classification)\n\n**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.\n\n### Fix\n\nA fix for this was introduced in this commit: https://github.com/vllm-project/vllm/commit/b3c7ffcab82c2439726f8cb213800f6f38c023d3","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-06-16T17:34:49.000Z","modified":"2026-10-25T23:10:00.167Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"},{"scorer":"redhat-SADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-94","CWE-617"],"affected":[{"ranges":[{"version":"< 0.22.0","status":"affected"}],"vendor":"vllm-project","product":"vllm","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1782951012","fixed":"*","status":"unaffected"},{"type":"rpm","introduced":"1787860580","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.2","package":"rhaiis/vllm-cuda-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3.2::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1782951244","fixed":"*","status":"unaffected"},{"type":"rpm","introduced":"1787884873","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.2","package":"rhaiis/vllm-rocm-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3.2::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787161382","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.3","package":"rhaiis/vllm-cuda-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3.3::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787161803","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.3","package":"rhaiis/vllm-rocm-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3.3::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787151769","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.4","package":"rhaii/vllm-cpu-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787151840","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.4","package":"rhaii/vllm-spyre-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787151771","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.4","package":"rhaii/vllm-cuda-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787151774","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat AI Inference Server 3.4","package":"rhaii/vllm-rocm-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1788290314","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.3","package":"rhelai3/disk-image-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.3::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1788273908","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.3","package":"rhelai3/bootc-aws-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.3::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1788273909","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.3","package":"rhelai3/bootc-azure-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.3::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1788273908","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.3","package":"rhelai3/bootc-azure-rocm-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.3::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1788260684","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.3","package":"rhelai3/bootc-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.3::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1788273977","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.3","package":"rhelai3/bootc-gcp-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.3::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1788260620","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.3","package":"rhelai3/bootc-rocm-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.3::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787310717","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.4","package":"rhelai3/disk-image-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787253912","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.4","package":"rhelai3/bootc-aws-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787253989","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.4","package":"rhelai3/bootc-azure-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787254059","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.4","package":"rhelai3/bootc-azure-rocm-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787243961","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.4","package":"rhelai3/bootc-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787253774","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.4","package":"rhelai3/bootc-gcp-cuda-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.4::el9","source":"cvelist"},{"ranges":[{"type":"rpm","introduced":"1787244006","fixed":"*","status":"unaffected"}],"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI 3.4","package":"rhelai3/bootc-rocm-rhel9","cpe":"cpe:/a:redhat:enterprise_linux_ai:3.4::el9","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat AI Inference Server","package":"rhaiis/vllm-neuron-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat AI Inference Server","package":"rhaiis/vllm-tpu-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat AI Inference Server","package":"rhaii/vllm-gaudi-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat AI Inference Server","package":"rhaii/vllm-neuron-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat AI Inference Server","package":"rhaii/vllm-tpu-rhel9","cpe":"cpe:/a:redhat:ai_inference_server:3","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-kserve-agent-rhel9","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-kserve-controller-rhel9","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-kserve-router-rhel9","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-kserve-storage-initializer-rhel9","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-llm-d-kv-cache-rhel9","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[],"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","package":"rhoai/odh-vllm-gaudi-rhel9","cpe":"cpe:/a:redhat:openshift_ai","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.22.0"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.22.0"}],"vendor":"vllm","product":"vllm","cpe":"cpe:2.3:a:vllm:vllm:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"0.22.0"}],"ecosystem":"PyPI","package":"vllm","purl":"pkg:pypi/vllm","source":"pysec"}],"references":[{"url":"https://github.com/vllm-project/vllm/security/advisories/GHSA-q8gq-377p-jq3r","tags":["evidence","exploit","third-party-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/vllm-project/vllm/commit/b3c7ffcab82c2439726f8cb213800f6f38c023d3","tags":["fix","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://huntr.com/bounties/dcb05b04-e625-41e7-adbc-bbae0cc2d64c","tags":["advisory","third-party-advisory","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-41523","tags":["vdb-entry","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2491582","tags":["issue-tracking","report","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-41523.json","tags":["web","x-sadp-csaf-vex"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://access.redhat.com/errata/RHSA-2026:61627","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:36005","tags":["advisory","vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://access.redhat.com/errata/RHSA-2026:61629","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:36006","tags":["advisory","vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://access.redhat.com/errata/RHSA-2026:59138","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:59139","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:57380","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:57389","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:57390","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:57387","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:62336","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:62335","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:59151","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://access.redhat.com/errata/RHSA-2026:59144","tags":["vendor-advisory","web","x-refsource-redhat"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41523","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/vllm-project/vllm","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/vllm/PYSEC-2026-2300.yaml","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-06-23T12:23:15.308Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41523","url":"https://www.cve.org/CVERecord?id=CVE-2026-41523","licence":"CVE Terms of Use","modified":"2026-09-04T12:04:58.778Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q8gq-377p-jq3r","url":"https://github.com/advisories/GHSA-q8gq-377p-jq3r","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:50.172Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41523","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41523","licence":"Public domain","modified":"2026-10-25T23:10:00.167Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-2300","url":"https://osv.dev/vulnerability/PYSEC-2026-2300","licence":"CC-BY-4.0","modified":"2026-07-13T07:15:12.552Z"}],"updatedAt":"2026-11-25T22:59:25.436Z","epss":{"score":0.00607,"percentile":0.50414,"date":"2026-12-01T12:00:22.000Z"}}