CVE-2026-5241: Policy Bypass in LightGlue Nested Config Resolution in 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.
Security readout for executives and security teams
Plain-English summary
This flaw can let a malicious Hugging Face model run Python code even when the user explicitly disables remote code trust. The business risk is highest where teams evaluate outside models or run automated inference pipelines with access to secrets, credentials, or internal networks.
Executive priority
Treat as high priority for ML platforms that ingest third-party models. The issue bypasses an explicit safety control, so normal user assumptions may be wrong. Prioritize patching and isolation before continuing automated evaluation of untrusted LightGlue models.
Technical view
In huggingface/transformers LightGlue loading, untrusted serialized configuration can override the intended trust_remote_code=False policy. The nested LightGlueConfig path propagates that value into AutoConfig.from_pretrained(), allowing attacker-supplied modules to execute during AutoModel.from_pretrained() initialization.
Likely exposure
Exposure is most likely in API inference servers, research notebooks, CI/CD model tests, and model evaluation workers that load LightGlue models from untrusted or attacker-controlled repositories. Affected version detail is incomplete; the description cites transformers 5.2.0 while the affected list says unspecified.
Exploitation context
The source bundle does not show CISA KEV listing or cited active exploitation. Exploitation requires a victim to load a malicious model repository. CVSS indicates network attack vector, high complexity, no privileges, user interaction required, changed scope, and high confidentiality and integrity impact.
Researcher notes
Key uncertainty is affected version range. The bundle names transformers 5.2.0 but also lists versions as unspecified. Analysis should focus on the LightGlue nested config path, trust_remote_code propagation, and whether downstream distributions carry the referenced patch or errata.
Mitigation direction
Apply Hugging Face and downstream vendor updates that include the referenced fix.
Use Red Hat errata where Red Hat-packaged transformers is in scope.
Avoid loading untrusted LightGlue model repositories in automated environments.
Restrict model workers from accessing production secrets or sensitive networks.
Check vendor guidance for exact fixed versions and backports.
Validation and detection
Inventory systems using huggingface/transformers and LightGlue model loading.
Identify code paths calling AutoModel.from_pretrained() on external model repositories.
Confirm whether installed packages include the referenced Hugging Face commit.
Review recent model-worker activity for unexpected Python module execution during initialization.
Validate Red Hat advisory applicability for managed or packaged deployments.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-829: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
The CVE wording references authentication or credential exposure, so valid-account and credential-access review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
2CVSS vectors
5Timeline events
2ADP providers
8Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: pocAutomatable: noTechnical Impact: total
CVSS vector scores
2 official scores
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-829 · source CWE mapping
Inclusion of Functionality from Untrusted Control Sphere
Inclusion of Functionality from Untrusted Control Sphere represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.