{"id":"CVE-2026-5241","published":"2026-06-03T12:33:10Z","modified":"2026-09-01T12:04:56Z","title":"Policy Bypass in LightGlue Nested Config Resolution in huggingface/transformers","vendor":"huggingface","product":"huggingface/transformers","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":8,"severity":"HIGH","version":"3.0","vector":"CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:H/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00597,"percentile":0.49461,"provenance":"source"},"cwes":[{"id":"CWE-829","name":"Inclusion of Functionality from Untrusted Control Sphere"}],"references":[{"url":"https://huntr.com/bounties/ceb3ce1a-4c45-497a-b25e-cb9a7685e619","tags":[]},{"url":"https://github.com/huggingface/transformers/commit/676559d5022b74aaa0cee1cee0842b7f27c5320e","tags":[]},{"url":"https://access.redhat.com/security/cve/CVE-2026-5241","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2484384","tags":["issue-tracking","x_refsource_REDHAT"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-5241.json","tags":["x_sadp-csaf-vex"]},{"url":"https://access.redhat.com/errata/RHSA-2026:42644","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:37275","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:34456","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:60520","tags":["vendor-advisory","x_refsource_REDHAT"]}],"priority":{"score":15.5,"factors":[{"name":"EPSS percentile","points":9.89},{"name":"CVSS severity","points":5.6}]},"vendorSlug":"huggingface","affectedVersions":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[">= unspecified, < 5.5.0"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2026-06-03T15:45:14.993177Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"transformers","vulnerableRanges":["<5.5.0","<=5.2.0"],"patched":["5.5.0"],"from":["GHSA-fgcw-684q-jj6r","PYSEC-2026-2290"],"provenance":"source"}],"summary":{"text":"A policy bypass in the LightGlue model loading path of huggingface/transformers 5.2.0 causes the trust_remote_code setting to be overridden by values read from an untrusted config.json in nested configuration resolution. An attacker can supply a malicious model repository that executes arbitrary Python code during model initialization, even when the victim calls AutoModel.from_pretrained() with trust_remote_code=False, provided the victim loads that repository and the attack requires user interaction in the form of loading the model.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:28:14Z"},"euvd":{"id":"EUVD-2026-34084","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2025-6921","published":"2025-09-23","fixed":"4.53.0","kev":false},{"cve":"CVE-2026-1839","published":"2026-04-07","fixed":"5.0.0","kev":false},{"cve":"CVE-2026-4372","published":"2026-05-24","fixed":"5.3.0","kev":false,"link":{"from":"CVE-2026-4372","to":"CVE-2026-5241","relation":"successor","confidence":"medium","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:transformers","fromFixed":"5.3.0","toFixed":"5.5.0","daysApart":10},{"kind":"similar","provenance":"machine","score":0.23,"basis":"same product + description similarity"}]}},{"cve":"CVE-2026-5241","published":"2026-06-03","fixed":"5.5.0","kev":false},{"cve":"CVE-2026-9856","published":"2026-08-02","fixed":"5.10.0","kev":false,"link":{"from":"CVE-2026-5241","to":"CVE-2026-9856","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:transformers","fromFixed":"5.5.0","toFixed":"5.10.0","daysApart":60}]}}],"package":"PyPI:transformers"}}