CVE-2026-5241
CVE-2026-5241 is a critical-severity vulnerability in Huggingface Transformers with a CVSS 3.x base score of 9.6. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-829.
Key facts
- Severity: Critical (CVSS 3.x base score 9.6)
- EPSS exploit prediction: 1% (40th percentile)
- Actively exploited: Not listed in CISA KEV
- EU (EUVD) id: EUVD-2026-34084
- Weakness: CWE-829
- Affected product: Huggingface Transformers
- Published:
- Last modified:
Description
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.
Frequently asked questions
- What is CVE-2026-5241?
- 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.
- How severe is CVE-2026-5241?
- CVE-2026-5241 has a CVSS 3.x base score of 9.6, rated critical severity. It is exploitable over network with low attack complexity, requires no privileges and user interaction. Impact on confidentiality is high, integrity high, and availability high.
- Is CVE-2026-5241 being actively exploited?
- It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 1% (40th percentile), an estimate of the probability of exploitation in the next 30 days.
- What products are affected by CVE-2026-5241?
- CVE-2026-5241 affects Huggingface Transformers. See the affected-products list for the exact vulnerable versions.
- How do I fix CVE-2026-5241?
- Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its critical severity, prioritise patching exposed systems.
- Does CVE-2026-5241 have an EU (EUVD) identifier?
- Yes. CVE-2026-5241 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2026-34084.
- When was CVE-2026-5241 published?
- CVE-2026-5241 was published on 2026-06-03 and last updated on 2026-07-02.
References
- https://github.com/huggingface/transformers/commit/676559d5022b74aaa0cee1cee0842b7f27c5320e
- https://huntr.com/bounties/ceb3ce1a-4c45-497a-b25e-cb9a7685e619
- https://access.redhat.com/errata/RHSA-2026:34456
- https://access.redhat.com/security/cve/CVE-2026-5241
- https://bugzilla.redhat.com/show_bug.cgi?id=2484384
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-5241.json
Affected products (1)
- cpe:2.3:a:huggingface:transformers:5.2.0:*:*:*:*:*:*:*
More vulnerabilities in Huggingface Transformers
- CVE-2024-3568 — Critical (CVSS 9.6): The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted…
- CVE-2024-11394 — High (CVSS 8.8): Hugging Face Transformers Trax Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. This…
- CVE-2024-11393 — High (CVSS 8.8): Hugging Face Transformers MaskFormer Model Deserialization of Untrusted Data Remote Code Execution Vulnerability. This…
- CVE-2024-11392 — High (CVSS 8.8): Hugging Face Transformers MobileViTV2 Deserialization of Untrusted Data Remote Code Execution Vulnerability. This…
- CVE-2023-6730 — High (CVSS 8.8): Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36.
- CVE-2026-4372 — High (CVSS 7.8): A critical remote code execution vulnerability exists in all versions of the HuggingFace transformers library prior to…
All CVEs affecting Huggingface Transformers →
Other CWE-829 vulnerabilities
- CVE-2026-1699 — Critical (CVSS 10.0): In the Eclipse Theia Website repository, the GitHub Actions workflow .github/workflows/preview.yml used…
- CVE-2025-70974 — Critical (CVSS 10.0): Fastjson before 1.2.48 mishandles autoType because, when an @type key is in a JSON document, and the value of that key…
- CVE-2025-0982 — Critical (CVSS 10.0): Sandbox escape in the JavaScript Task feature of Google Cloud Application Integration allows an actor to execute…
- CVE-2021-41037 — Critical (CVSS 10.0): In Eclipse p2, installable units are able to alter the Eclipse Platform installation and the local machine via…
- CVE-2022-1161 — Critical (CVSS 10.0): An attacker with the ability to modify a user program may change user program code on some ControlLogix, CompactLogix,…
- CVE-2020-4561 — Critical (CVSS 10.0): IBM Cognos Analytics 11.0 and 11.1 DQM API allows submitting of all control requests in unauthenticated sessions. This…