CVE-2026-5241: CWE-829 Inclusion of Functionality from Untrusted Control Sphere in huggingface huggingface/transformers
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.
AI Analysis
Technical Summary
The vulnerability in huggingface/transformers 5.2.0 arises because the trust_remote_code parameter, which is intended to prevent remote code execution, is overridden by untrusted serialized configuration data in the LightGlue model loading path. Specifically, when loading a LightGlue model using AutoModel.from_pretrained() with trust_remote_code set to 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 leads to execution of attacker-provided Python modules despite explicit disabling of remote code execution. The CVSS v3.0 score is 8.0, indicating high severity with network attack vector, high complexity, no privileges required, user interaction required, scope changed, and high confidentiality and integrity impact. The vulnerability poses risks in various environments that load models from potentially untrusted repositories.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary code during model initialization in huggingface/transformers 5.2.0. This can lead to credential theft, lateral movement within the victim environment, or deployment of persistence mechanisms or backdoors. The vulnerability affects any environment that loads LightGlue models from attacker-controlled repositories, including API inference servers, research notebooks, CI/CD pipelines, and model evaluation workers. The integrity and confidentiality of affected systems are severely impacted, while availability is not directly affected.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, users should avoid loading LightGlue models from untrusted or unauthenticated sources. Explicitly verify the trustworthiness of model repositories before loading. Monitor vendor advisories, including the Red Hat advisory at https://access.redhat.com/security/cve/CVE-2026-5241, for updates on patches or official mitigations.
CVE-2026-5241: CWE-829 Inclusion of Functionality from Untrusted Control Sphere in huggingface huggingface/transformers
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.
CVSS v3.0
Score 8.0high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in huggingface/transformers 5.2.0 arises because the trust_remote_code parameter, which is intended to prevent remote code execution, is overridden by untrusted serialized configuration data in the LightGlue model loading path. Specifically, when loading a LightGlue model using AutoModel.from_pretrained() with trust_remote_code set to 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 leads to execution of attacker-provided Python modules despite explicit disabling of remote code execution. The CVSS v3.0 score is 8.0, indicating high severity with network attack vector, high complexity, no privileges required, user interaction required, scope changed, and high confidentiality and integrity impact. The vulnerability poses risks in various environments that load models from potentially untrusted repositories.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary code during model initialization in huggingface/transformers 5.2.0. This can lead to credential theft, lateral movement within the victim environment, or deployment of persistence mechanisms or backdoors. The vulnerability affects any environment that loads LightGlue models from attacker-controlled repositories, including API inference servers, research notebooks, CI/CD pipelines, and model evaluation workers. The integrity and confidentiality of affected systems are severely impacted, while availability is not directly affected.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, users should avoid loading LightGlue models from untrusted or unauthenticated sources. Explicitly verify the trustworthiness of model repositories before loading. Monitor vendor advisories, including the Red Hat advisory at https://access.redhat.com/security/cve/CVE-2026-5241, for updates on patches or official mitigations.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- @huntr_ai
- Date Reserved
- 2026-03-31T14:26:14.353Z
- Cvss Version
- 3.0
- State
- PUBLISHED
- Remediation Level
- null
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-5241","vendor":"Red Hat"}]
Threat ID: 6a2037c7e29bf47b50c14ed8
Added to database: 06/03/2026, 14:18:47 UTC
Last enriched: 07/31/2026, 13:01:54 UTC
Last updated: 07/31/2026, 21:34:08 UTC
Views: 107
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.