CVE-2026-5241 Details
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.
A vulnerability exists in the LightGlue model loading process of Hugging Face Transformers version 5.2.0. It allows an attacker-controlled model repository to execute arbitrary code during model initialization. This issue arises because the 'trust_remote_code' parameter, designed to prevent remote code execution, is overridden by untrusted serialized configuration data from the model's 'config.json' file. When a LightGlue model is loaded with 'trust_remote_code=False', the configuration file can still inject a 'trust_remote_code=True' value, which is then used to execute attacker-provided Python modules. This vulnerability is particularly concerning for environments such as API inference servers, research notebooks, CI/CD pipelines, and model evaluation workers, where it could lead to credential theft, unauthorized access to other services, or the deployment of backdoors.
Users can update to Hugging Face Transformers version 5.9.0 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jun 3, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://access.redhat.com/errata/RHSA-2026:34456 | redhat-SADP | |
| https://access.redhat.com/errata/RHSA-2026:37275 | redhat-SADP | |
| https://access.redhat.com/errata/RHSA-2026:42644 | redhat-SADP | |
| https://access.redhat.com/errata/RHSA-2026:60520 | redhat-SADP | |
| https://access.redhat.com/security/cve/CVE-2026-5241 | redhat-SADP | |
| https://bugzilla.redhat.com/show_bug.cgi?id=2484384 | redhat-SADP | |
| https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-5241.json | redhat-SADP | |
| https://huntr.com/bounties/ceb3ce1a-4c45-497a-b25e-cb9a7685e619 | CISA-ADP | ExploitThird Party Advisory |
| https://github.com/huggingface/transformers/commit/676559d5022b74aaa0cee1cee0842b7f27c5320e | [email protected] | Patch |
| https://huntr.com/bounties/ceb3ce1a-4c45-497a-b25e-cb9a7685e619 | [email protected] | ExploitThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | redhat-SADP |
| CWE-829 | Inclusion of Functionality from Untrusted Control Sphere | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| huggingface transformers | 5.2.0 |
CPE
Remediation
| |
Change History
17 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 28, 2026 | CVE Modified | redhat-SADP |
| Aug 28, 2026 | CVE Modified | [email protected] |
| Aug 28, 2026 | CVE Modified | CISA-ADP |
| Aug 19, 2026 | CVE Modified | redhat-SADP |
| Aug 12, 2026 | CVE Modified | redhat-SADP |
| Jul 22, 2026 | CVE Modified | redhat-SADP |
| Jul 21, 2026 | CVE Translated | [email protected] |
| Jul 21, 2026 | CVE Modified | redhat-SADP |
| Jul 15, 2026 | CVE Modified | redhat-SADP |
| Jul 10, 2026 | CVE Modified | redhat-SADP |
| Jul 2, 2026 | CVE Modified | redhat-SADP |
| Jun 30, 2026 | CVE Modified | redhat-SADP |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 4, 2026 | Initial Analysis | [email protected] |
| Jun 3, 2026 | CVE Modified | CISA-ADP |
| Jun 3, 2026 | New CVE Received | [email protected] |