TransformersApplication · Huggingface

CVE-2026-5241

CRITICAL · 9.6 CVSS v3.1 Published 2026-06-03
Patch available
A vendor patch is available. No clean upgrade release — apply the published patch.
See remediation →
100/100
Remediation priority · Urgent
Public exploit Remotely reachable No privileges Patch available

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

A vulnerability in huggingface/transformers v5.2.0 allows arbitrary code execution when loading LightGlue models. The trust_remote_code parameter, intended as a security safeguard, is overridden by untrusted values in config.json. Specifically, LightGlueConfig reads the trust_remote_code setting from the model's config.json file and propagates it into nested AutoConfig.from_pretrained() calls, bypassing the user's explicit security setting and enabling execution of attacker-provided Python code.

MitigationDo not load models from untrusted or unknown model repositories, even when trust_remote_code=False is set. Wait for the official patch in transformers and verify that LightGlueConfig no longer allows config.json to override the trust_remote_code parameter.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
TransformersApplication
Affected:= 5.2.0

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Check installed transformers version
    Run 'pip show transformers' or 'import transformers; print(transformers.__version__)'
    Affected if Version is exactly 5.2.0
  2. Identify LightGlueConfig usage in model loading
    Search codebase for 'LightGlueConfig' or 'from_pretrained' calls loading models that use LightGlue
    Affected if Code loads a model that uses LightGlueConfig from a config.json file
  3. Inspect config.json for trust_remote_code override
    Examine the config.json file of any model being loaded; look for a 'trust_remote_code' key in the JSON
    Affected if config.json contains a trust_remote_code key that could override user-specified False value
  4. Verify trust_remote_code parameter handling
    Test loading a model with trust_remote_code=False explicitly set, then inspect the resulting config object to see if the parameter was changed
    Affected if The trust_remote_code value changes from False to True after loading despite being explicitly set to False

You are affected if you are running transformers version 5.2.0 and loading LightGlue models from repositories containing config.json files with trust_remote_code set to true, causing your explicit trust_remote_code=False setting to be overridden.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

From vendor data
Patch available Apply the vendor patch
Vendor patch github.com →
Interim mitigation

Do not load models from untrusted or unknown model repositories, even when trust_remote_code=False is set. Wait for the official patch in transformers and verify that LightGlueConfig no longer allows config.json to override the trust_remote_code parameter.

Fix this in Transformers Scoped from the published advisory
  • Consultation4.0 h
  • Implementation8.0 h
  • Testing6.0 h
  • Review / QA4.0 h
22.0 hours of engineering $3,860
Get the patch applied

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $6,176.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-5241 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-5241 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data