Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconPublish malicious LightGlue model repo
-
DeliveryEmbed trust_remote_code=true in config.json
-
ExploitVictim calls AutoModel.from_pretrained with trust_remote_code=False
-
InstallLightGlueConfig overrides flag from config
-
C2Nested AutoConfig loads attacker Python module
-
ExecuteArbitrary code executes in victim process
-
ImpactCredential theft and lateral movement
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Trusted source inclusion only
|
| Exploitation Conditions | Victim must invoke AutoModel.from_pretrained() (or an equivalent loader) against an attacker-controlled or compromised model repository that advertises itself as a LightGlue keypoint-matching model and ships a config.json with trust_remote_code embedded as a serialized field. Exploitation specifically requires (a) Transformers version in the vulnerable range (5.2.0 per NVD CPE, <5.5.0 per EUVD), (b) the LightGlue code path - other model architectures are not affected by this particular bypass, and (c) UI:R per CVSS, meaning a human or automated job must initiate the load; the attacker does not need credentials or network position on the victim host. The bypass works even when the user explicitly passes trust_remote_code=False, which removes the most obvious limiting factor users would otherwise rely on. Exploitation is NOT possible against pipelines that only load fully vetted, locally hosted models or that pin to known-safe commit SHAs of trusted publishers. |
| Impact | Signals are mixed and need to be weighed together. CVSS 9.6 is justified by network attack vector, low complexity, no privileges, scope change (the user process is the only confused deputy and gets fully compromised), and high impact on C/I/A - UI:R reflects that a user must initiate the model load. SSVC marks technical impact as total but automatable as no and exploitation as PoC, which aligns with the Huntr bounty disclosure containing a working proof of concept. EPSS at 0.07% (22th percentile) is low, indicating no observed mass exploitation, and the CVE is NOT on CISA KEV. The realistic risk is high for any environment that loads third-party models from the Hub (research notebooks, inference servers, MLOps pipelines) because users were relying on trust_remote_code=False as a hard guarantee that this CVE proves untrustworthy; conversely, environments restricted to vetted internal models face limited exposure. Note that the NVD CPE only lists 5.2.0 while the EUVD says <5.5.0 - defenders should treat the broader EUVD range as authoritative until vendor confirms. |
| Exploit ScenarioDerived | An attacker publishes (or compromises) a LightGlue-compatible model repository on the Hugging Face Hub whose config.json sets trust_remote_code: true and references a malicious custom keypoint-detector module. A data scientist or CI/CD pipeline running Transformers 5.2.0 loads the model with AutoModel.from_pretrained('attacker/lightglue-model', trust_remote_code=False), believing they are safe; LightGlueConfig overwrites the runtime flag from the config and Python in the attacker's module executes inside the victim process, enabling credential theft from environment variables, exfiltration of training data, or installation of a persistent backdoor. A proof of concept exists in the Huntr submission. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv3 – Jun 04, 2026
Remote code execution in Hugging Face Transformers 5.2.0 allows a malicious model repository to bypass the user's explicit trust_remote_code=False safeguard when loading a LightGlue model via AutoModel.from_pretrained(). The LightGlueConfig deserializes the trust_remote_code flag from the untrusted config.json and propagates the attacker-controlled value into a nested AutoConfig.from_pretrained() call, enabling execution of arbitrary attacker-supplied Python during model initialization. Rated CVSS 9.6 (AV:N/AC:L/PR:N/UI:R) with publicly available exploit code exists via the Huntr disclosure, though EPSS is currently 0.07% (22th percentile) and the CVE is not on CISA KEV.
Earlier versions of this analysis (2)
Remote code execution in Hugging Face Transformers 5.2.0 (and earlier, fixed in 5.5.0) allows an attacker-controlled model repository to bypass the user's explicit trust_remote_code=False safeguard when loading a LightGlue keypoint-matching model via AutoModel.from_pretrained(). Because LightGlueConfig reads the trust_remote_code value out of the untrusted config.json and forwards it into a nested AutoConfig.from_pretrained() call for the keypoint detector, a malicious model can force loading of attacker-supplied Python modules during initialization. No public exploit is identified at time of analysis, EPSS is low (0.07%, 22nd percentile), and SSVC marks exploitation as POC with total technical impact but not automatable.
Arbitrary code execution in Hugging Face Transformers 5.2.0 occurs when loading a LightGlue model via AutoModel.from_pretrained() with trust_remote_code=False, because LightGlueConfig honors a trust_remote_code field read from the untrusted config.json and propagates it into nested AutoConfig.from_pretrained() calls. An attacker who controls a model repository can override the victim's explicit safety choice and execute arbitrary Python during model initialization. No public exploit identified at time of analysis, but a vendor commit and huntr bounty disclosure confirm the root cause.
RemediationAI
Vendor-released patch: upgrade huggingface/transformers to 5.5.0 or later, which removes the trust_remote_code attribute from LightGlueConfig and eliminates the nested AutoConfig.from_pretrained() call that consumed it (commit 676559d5022b74aaa0cee1cee0842b7f27c5320e). If immediate upgrade is not possible, restrict LightGlue model loading to repositories you control or have audited - specifically inspect each model's config.json for an injected trust_remote_code key before calling from_pretrained, and prefer pinning to a known-good revision SHA rather than a tag. As a stronger compensating control, run model-loading workers under a non-privileged user inside a sandbox (gVisor, Firecracker, or a container without outbound network) so that arbitrary Python execution cannot reach credentials or perform lateral movement; the trade-off is added operational complexity and potential breakage of legitimate models that need network access at load. Refer to the Huntr advisory at https://huntr.com/bounties/ceb3ce1a-4c45-497a-b25e-cb9a7685e619 for full disclosure details.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in pypi, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Hugging Face Transformers is the de facto Python library for loading and running pretrained ML models from the Hugging Face Hub. The trust_remote_code parameter is a critical security control that gates whether custom Python modules shipped alongside a model are imported and executed at load time; setting it to False is the documented way to refuse arbitrary code from a model repo. The root cause maps to CWE-829 (Inclusion of Functionality from Untrusted Control Sphere): LightGlueConfig defined trust_remote_code as a serialized config field with default False, so an attacker who controls config.json could override the user's runtime choice. The diff (commit 676559d) removes the trust_remote_code attribute from LightGlueConfig entirely, drops the dynamic AutoConfig.from_pretrained() branch for unknown keypoint detectors, and adds a new mlinter rule (TRF014) banning trust_remote_code inside native model integrations going forward. Affected CPE is cpe:2.3:a:huggingface:transformers:5.2.0; per the ENISA EUVD record the issue extends to all versions below 5.5.0.
Know when Hugging Face gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
3DescriptionNVD
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.
Blast Radius
ecosystem impact- 33 pypi packages depend on transformers (21 direct, 13 indirect)
Ecosystem-wide dependent count for version 5.2.0.
Executive ViewAI
Hugging Face Transformers 5.2.0 contains a critical remote code execution vulnerability in LightGlue model loading; publicly available exploit code exists, enabling unauthenticated attackers to execute arbitrary code when users load malicious model repositories. Any organization using Transformers for model inference faces immediate risk to development and production AI infrastructure.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
More in Hugging Face
View allThe huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data
Arbitrary Python code execution in LMDeploy 0.12.1 through 0.12.2 lets an attacker who publishes a malicious model on Hu
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,
The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (R
Path traversal in Hugging Face Datasets up to 5.0.0 allows attackers to read arbitrary local files when a victim process
Path traversal in Hugging Face Accelerate through 1.14.0 exposes two distinct attack outcomes when a user loads a crafte
Server-side request forgery in HuggingFace text-generation-inference through version 3.3.7 enables unauthenticated remot
A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe
XPath injection in Hugging Face Smolagents 1.20.0 lets an attacker who can influence the text passed to the vision web b
Unauthenticated remote code execution in HuggingFace LeRobot (versions 0 through 0.5.1) stems from pickle.loads() being
EUVD-2026-34084
GHSA-fgcw-684q-jj6r
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB