Vulnerability in Huggingface Huggingface/transformers

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.

Published · last modified .

CVSS v3 metric

CVSS v3 base score 9.6 (Critical). Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.

EPSS exploit prediction

EPSS: 0.009 (60.1th percentile), scored .

Very low probability of exploitation in the next 30 days; routine patching cadence is appropriate. 60th percentile — 60.1% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.

EPSS trend (30 days)EPSS over the last 30 days for CVE-2026-5241: held from 0.006 to 0.009.

EPSS over last 30 days · oldest: 0.006 · newest: 0.009 · change: +0.003

Affected products

Weakness classification (CWE)

References

Frequently asked questions

What is CVE-2026-5241?
CVE-2026-5241 is a critical-severity vulnerability in Huggingface Huggingface/transformers, classified under Inclusion of Functionality from Untrusted Control Sphere. CVSS score: 9.6/10. Published 2026-06-03.
How severe is CVE-2026-5241?
Critical severity. CVSS v3 base score is 9.6 out of 10.