cve.bz

CVE-2026-5241 huggingface transformers

9.6 criticalExploit referenceEPSS 0.6%Fix available

Critical (9.6) in huggingface transformers. EPSS 0.6% estimated probability of exploitation activity in the next 30 days. Fixed in transformers 5.5.0.

On this page
A vulnerability in the LightGlue model loading path of huggingface/transformers version 5.2.0 allows an attacker-controlled model repository to execute arbitrary code during model initialization. The issue arises because the `trust_remote_code` parameter, intended to prevent remote code execution, is overridden by untrusted serialized configuration data in a nested code path. Specifically, when loading a LightGlue model using `AutoModel.from_pretrained()` with `trust_remote_code=False`, the `LightGlueConfig` reads the `trust_remote_code` value from the untrusted `config.json` file and propagates it into nested `AutoConfig.from_pretrained()` calls. This results in the execution of attacker-provided Python modules, even when the victim explicitly disables remote code execution. The vulnerability poses a high risk for environments such as API inference servers, research notebooks, CI/CD pipelines, and model evaluation workers, potentially leading to credential theft, lateral movement, or persistence/backdoor deployment.

Severity

CVSS 3.1

9.6 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
EPSS
0.6% (unchanged from 0.6% a week ago; 0.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 49th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: total, assessed 2026-06-03. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-829 Inclusion of Functionality from Untrusted Control Sphere
OWASP Top 10
A08:2025 Software or Data Integrity Failures
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-5241 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-5241?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-5241?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-5241 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
huggingface/transformersbefore 5.5.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-fgcw-684q-jj6rPyPItransformers<5.5.05.5.0
PYSEC-2026-2290PyPItransformers<=5.2.0no fix published

Red Hat

Red Hat rates this Important.

Red Hat's statement

This Important vulnerability in `python-transformers` allows for arbitrary code execution when loading a malicious LightGlue model, even if `trust_remote_code` is explicitly set to `False`. This occurs because untrusted serialized configuration data can override the security setting in nested model loading paths. Red Hat products utilizing `python-transformers` for AI/ML workloads, such as Red Hat AI Inference Server and Red Hat OpenShift AI, are affected, posing a significant risk of credential theft or system compromise if untrusted models are processed. The LightGlue model (and its vulnerable trust_remote_code handling) was introduced in transformers 4.53.0 and fixed in 5.5.0; the CNA-published affected range is all versions before 5.5.0.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat AI Inference Server 3.4rhaii/vllm-spyre-rhel9:1789681201Fixed 2026-09-21RHSA-2026:69464
Red Hat AI Inference Server 3.4rhaii/vllm-cpu-rhel9:1789681128Fixed 2026-09-21RHSA-2026:69466
Red Hat AI Inference Server 3.4rhaii/vllm-cuda-rhel9:1789681126Fixed 2026-09-21RHSA-2026:69467
Red Hat AI Inference Server 3.4rhaii/model-opt-cuda-rhel9:1789681126Fixed 2026-09-21RHSA-2026:69468
Red Hat AI Inference Server 3.4rhaii/vllm-rocm-rhel9:1789681126Fixed 2026-09-21RHSA-2026:69469
Red Hat AI Inference Server 3.4rhaii/vllm-cpu-rhel9:1790075793Fixed 2026-09-23RHSA-2026:70965
Red Hat AI Inference Server 3.4rhaii/vllm-spyre-rhel9:1790076141Fixed 2026-09-23RHSA-2026:70969
Red Hat AI Inference Server 3.4rhaii/vllm-cuda-rhel9:1790090131Fixed 2026-09-23RHSA-2026:70979
Red Hat AI Inference Server 3.4rhaii/vllm-rocm-rhel9:1790109620Fixed 2026-09-23RHSA-2026:70995
Red Hat AI Inference Server 3.4rhaii/model-opt-cuda-rhel9:1790076498Fixed 2026-09-23RHSA-2026:70996
OpenShift Lightspeedopenshift-lightspeed/lightspeed-ocp-rag-rhel9Not affected
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Not affected
OpenShift Lightspeedopenshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9Not affected
Red Hat AI Inference Serverrhaiis/model-opt-cuda-rhel9Will not fix
Red Hat AI Inference Serverrhaiis/vllm-cpu-rhel9Will not fix
Red Hat AI Inference Serverrhaiis/vllm-cuda-rhel9Will not fix
Red Hat AI Inference Serverrhaiis/vllm-neuron-rhel9Will not fix
Red Hat AI Inference Serverrhaiis/vllm-rocm-rhel9Will not fix
Red Hat AI Inference Serverrhaiis/vllm-spyre-rhel9Will not fix
Red Hat AI Inference Serverrhaiis/vllm-tpu-rhel9Will not fix
66 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-5241.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-829 (13).

References

Check your stackJSON