// threat brief

Hugging Face Transformers LightGlue loading: a model's config can override trust_remote_code=False and run the model's own code

CVSS
9.6 CRITICAL
CISA KEV
Not listed
Weakness
CWE-829

PlainCVE Team · Published 2026-09-24 · AI-assisted · Press brief ↓

Human review 2026-09-24Command tests: none yetReproduced: not yetVerification record ↓

In Transformers before 5.5.0, a LightGlue model's own config could override trust_remote_code=False and run the model's bundled Python code.

Who is affectedPeople and automation that load LightGlue-type models with transformers before 5.5.0 (the official range; code inspection suggests the risky path starts around 4.54.0), such as inference servers, notebooks, CI pipelines and model evaluation workers. Red Hat OpenShift AI, AI Inference Server and other products are also listed as affected.
What happensIf the model being loaded was made or altered by an attacker, the attacker's Python code runs with the loader's permissions and could steal credentials, plant backdoors, or be used to move deeper into the network.
What to do nowUpgrade transformers to 5.5.0 or later. Until then, don't load LightGlue-type models from untrusted sources; setting trust_remote_code=False yourself does not protect affected versions.
View evidence(4)
  • Vendor / maintainerHugging Face release notes: after upgrading, drop trust_remote_code=True when loading LightGlueusers who were loading `LightGlue` with `trust_remote_code=True` must remove that argumentapi.github.com
  • Vulnerability databaseRed Hat says no mitigation meets its criteria, so applying the update is requiredMitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteriaaccess.redhat.com
  • Our assessmentThe vendor offers no workaround; until you upgrade, don't load LightGlue-type models from unknown sources, because setting trust_remote_code=False yourself does not help on affected versions
  • Our assessmentRotating keys and tokens on a machine that loaded an untrusted model is our own precautionary advice, not a confirmed leak
Affected versionsOfficial advisory: before 5.5.0. Versions that actually contain the risky code appear to be about 4.54.0 up to but not including 5.5.0 (PlainCVE spot check, not officially confirmed); NVD's CPE lists only 5.2.0.
View evidence: sources disagree(4)
  • CVE recordDisputedCVE record's affected range: before 5.5.0"lessThan":"5.5.0"cveawg.mitre.org
  • Vulnerability databaseDisputedNVD's CPE lists only version 5.2.0"criteria":"cpe:2.3:a:huggingface:transformers:5.2.0:*:*:*:*:*:*:*"services.nvd.nist.gov
  • Our assessmentDisputedOur own spot check of the source: 4.53.0 lacks this code path, and the risky code appears from about 4.54.0; not checked for every version and not confirmed by the vendor
  • Vulnerability databaseGitHub Advisory Database: the precondition is loading a LightGlue-type model; LightGlueConfig reads trust_remote_code from the untrusted config.jsonthe LightGlueConfig reads the trust_remote_code value from the untrusted config.json filegithub.com
Fixed versions5.5.0 or later
View evidence(4)
  • Vendor / maintainerHugging Face 5.5.0 release notes: remote code execution support was removed from the native LightGlue integrationRemote code execution support has been removed from the native `LightGlue` integrationapi.github.com
  • Vendor / maintainerFix PR #45122: a native model integration should have nothing to do with remote code executionNative model integration should never have anything related to remote code executiongithub.com
  • Vulnerability databaseGitHub Advisory Database: the first patched version is 5.5.0github.com
  • Vulnerability databaseRed Hat has issued security updates for its affected products, such as RHSA-2026:34456access.redhat.com
CVSS vector
Show full vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Timeline
  • Introduced 2025-07-25 · v4.54.0 released, first version with PR #39253 source
  • First public 2026-06-03
CISA KEVNot listed(Not being in KEV does not mean it has not been exploited)
View evidence(2)
  • Our assessmentOur 2026-09-24 CISA KEV snapshot does not list this CVE; not being listed does not mean it has not been exploited
  • Vulnerability databaseThe GitHub advisory listed an EPSS (predicted exploitation probability) of about 0.6% at the time; that is a prediction, not a record of exploitationgithub.com

Blue team playbook

Check, fix / mitigate, respond, harden. Matching the affected versions does not mean you were compromised, and a check that finds nothing does not prove you are safe; each item says what it can and cannot show. Tagged steps point to where the attack flow below can be stopped.

DETECTCheckAm I affected? Any signs of compromise?
  1. 01Check your installed transformers version

    Anything below 5.5.0 is in the official affected range. Versions before 4.53.0 have no LightGlue, and 4.53.0's LightGlue config lacks this handling, but the official range still says "before 5.5.0", so upgrade to be safe.

    Read-only check
    pip show transformers | grep -i '^version'
  2. 02Find code and jobs that load LightGlue-type models

    Only loading LightGlue-type models reaches this path. Search your code, notebooks and CI config for LightGlue use and confirm where those models come from.

    Read-only check
    grep -rniI "lightglue" .
  3. 03Inspect downloaded models' config files

    PlainCVE's suggestion (not official detection guidance): look in your local model cache for configs containing a trust_remote_code field and confirm each model's source is trusted. A match is not proof of compromise.

    Read-only check
    grep -rl --include=config.json 'trust_remote_code' ~/.cache/huggingface/hub
MITIGATEFix / mitigatePatch; block it if you cannot patch yet
  1. 01Upgrade to transformers 5.5.0 or later

    The fix removes trust_remote_code from LightGlueConfig and only allows built-in keypoint detectors. Red Hat says no mitigation meets its criteria, so updating is the answer.

    Changes your environment
    pip install -U "transformers>=5.5.0"
  2. 02After upgrading, remove trust_remote_code=True from LightGlue calls

    The 5.5.0 release notes list this as a breaking change; LightGlue variants that relied on remote code, such as lightglue_disk, are no longer supported.

  3. 03Red Hat products: apply the matching errata

    The CVE record lists OpenShift AI, AI Inference Server, Enterprise Linux AI and other products, with errata RHSA-2026:34456, 37275, 42644 and 60520. Check Red Hat's page for each product's fix status.

RESPONDRespondIf you find signs of compromise
  1. 01If an untrusted model was loaded: rotate that machine's secrets

    No official indicators or response guidance were published. PlainCVE's precautionary advice: treat API tokens, cloud keys and similar secrets on that machine as possibly exposed, rotate them, and check for backdoors or unusual outbound connections. This does not confirm a leak.

HARDENHardenPrevent the next one
  1. 01Manage models like code dependencies

    Load models only from trusted sources and pin them to a specific revision so their contents can't change without you noticing.

  2. 02Handle unknown models in isolated environments

    Keep production credentials off machines that evaluate or test external models and limit their network access, so that if code does run, the damage stays limited.

Full remediation steps and notes
  1. Upgrade: pip install -U "transformers>=5.5.0". If your project uses a requirements file or lockfile (a file that pins dependency versions), raise the minimum version there too.
  2. Compatibility after upgrading: from 5.5.0, any trust_remote_code=True passed when loading LightGlue must be removed; variants that relied on remote code (such as lightglue_disk) are no longer supported.
  3. Red Hat products: update via RHSA-2026:34456, 37275, 42644 and 60520. Red Hat says no mitigation meets its criteria.
  4. No official workaround, indicators of compromise or detection guidance were published. Until you upgrade, the only practical step is not loading untrusted LightGlue-type models.

Attack flow

Read left to right: this is the order the attack happens in. A blue shield means the step can be stopped; the earlier, the better. Click an icon for details.

Hugging Face Transformers LightGlue loading: a model's config can override trust_remote_code=False and run the model's own code: 1. The attacker publishes a LightGlue-type model that ships its own Python code → 2. A user or automated job downloads and loads the model with trust_remote_code=False → 3. The LightGlue config uses trust_remote_code from the model's data, overriding the caller's False → 4. The model's bundled Python modules run while the model is being set up → 5. The attacker's code runs with the loader's permissionsCVE-2026-5241 · Hugging Face Transformers LightGlue loading: a model's config can overridetrust_remote_code=False and run the model's own codeAttackerYour systemThe attacker publishes a LightGlue-type model that ships its own Python code — The model's configuration points to a keypoint detector the library doesn't recognise and records the "trust remote code" switch as on. 1The attackerpublishes aLightGlue-typemodel that ship…A user or automated job downloads and loads the model with trust_remote_code=False — This could be a researcher's notebook, an inference server, a CI pipeline or a model evaluation worker. All three scorers say someone must choose to load the model (UI:R). 2A user orautomated jobdownloads andloads the mode…The LightGlue config uses trust_remote_code from the model's data, overriding the caller's False — Affected versions store this safety switch as an ordinary config field, and when loading the nested detector config they pass along the config object's own value instead of the caller's choice. 3The LightGlueconfig usestrust_remote_codefrom the model'…The model's bundled Python modules run while the model is being set up — The CVE record describes this as a policy bypass that runs attacker-supplied Python modules during initialisation. 4The model'sbundled Pythonmodules run whilethe model is bein…The attacker's code runs with the loader's permissions — The advisory's listed possible impacts include credential theft, lateral movement and backdoors. 5The attacker'scode runs with theloader'spermissionsAttack pathCan be stopped herePlainCVE · plaincve.date/en/vulns/cve-2026-5241-transformers-lightglue-remote-code-override · CC BY 4.0
Free to use in reporting and teaching under CC BY 4.0. Attribution is already on the image.
  1. Attacker

    The attacker publishes a LightGlue-type model that ships its own Python code

    The model's configuration points to a keypoint detector the library doesn't recognise and records the "trust remote code" switch as on.

    Defense: Load models only from trusted sources and pin them to a specific revision.

  2. Your system

    A user or automated job downloads and loads the model with trust_remote_code=False

    This could be a researcher's notebook, an inference server, a CI pipeline or a model evaluation worker. All three scorers say someone must choose to load the model (UI:R).

    Defense: Upgrade to transformers 5.5.0 or later; on affected versions, don't load untrusted LightGlue-type models.

  3. Your system

    The LightGlue config uses trust_remote_code from the model's data, overriding the caller's False

    Affected versions store this safety switch as an ordinary config field, and when loading the nested detector config they pass along the config object's own value instead of the caller's choice.

    Defense: The 5.5.0 fix removes trust_remote_code from LightGlueConfig and accepts only detectors built into the library.

  4. Your system

    The model's bundled Python modules run while the model is being set up

    The CVE record describes this as a policy bypass that runs attacker-supplied Python modules during initialisation.

    Defense: Handle models of unknown origin in isolated environments that hold no secrets.

  5. Attacker

    The attacker's code runs with the loader's permissions

    The advisory's listed possible impacts include credential theft, lateral movement and backdoors.

    Defense: If an untrusted model was loaded, treat the machine's keys and tokens as possibly exposed and rotate them.

Who is affected

Hugging Face Transformers is a Python library for downloading and running AI models. Some models ship with their own Python code (“remote code”). The library won’t run it by default unless the caller explicitly passes trust_remote_code=True. This bug let the loading path for LightGlue (a model that matches features between two images) get around that default.

Version / productStatus
Before 4.53.0No LightGlue yet, though the official range still says “before 5.5.0”
4.53.0Has LightGlue, but its config has no trust_remote_code handling (PlainCVE source check)
About 4.54.0 up to before 5.5.0Contains the risky code (spot-checked 4.54.0, 4.55.0, 4.57.0, 5.2.0; not every release checked)
5.2.0The advisory’s tested version and the only version in NVD’s CPE entry
5.5.0 or laterFixed
Red Hat OpenShift AI 2.25 / 3.3 / 3.4, AI Inference Server 3, Enterprise Linux AI 3Listed as affected in the CVE record; there is also an Ansible Automation Platform 2 entry whose exact product is unconfirmed

Preconditions: you must be on an affected version and load a LightGlue-type model that an attacker made or altered. That could be a person, or automation such as CI (automated build-and-test pipelines), model evaluation workers or inference servers. On affected versions, setting trust_remote_code=False yourself does not help, because that is exactly the setting that gets overridden.

How it works

LightGlue works alongside a “keypoint detector” model (usually SuperPoint). In affected versions, LightGlueConfig accepted trust_remote_code as an ordinary config field (default False) and stored it on the config object. When the nested detector config named a model type the library didn’t recognise, the code loaded that config from a model repository and passed along the config object’s own trust_remote_code value rather than the caller’s choice.

PlainCVE’s reading (not spelled out word for word by an official source): a value stored on the config object ends up in the model’s config.json, which the model’s publisher controls. The advisory’s wording, that the setting is overridden by untrusted configuration data, fits this. The weakness maps to CWE-829 (inclusion of functionality from an untrusted control sphere).

The flawed approach (conceptual illustration, not the original source code):

Show code example(python)
class PairMatcherConfig:
    def __init__(self, detector_config, trust_remote_code=False, **kwargs):
        # The safety switch is an ordinary field, so it travels with the model's config.json
        self.trust_remote_code = trust_remote_code
        if detector_config["model_type"] not in BUILTIN_MODELS:
            detector_config = load_config_from_repo(
                detector_config,
                trust_remote_code=self.trust_remote_code,  # value comes from model data
            )

The fixed approach:

Show code example(python)
class PairMatcherConfig:
    def __init__(self, detector_config, **kwargs):
        # Never take the safety switch from model data; pick only from the built-in list
        if detector_config["model_type"] not in BUILTIN_MODELS:
            raise ValueError("Only built-in keypoint detectors are supported")
        detector_config = BUILTIN_MODELS[detector_config["model_type"]](**detector_config)

The fix (PR #45122) also adds a linter rule, TRF014, that flags trust_remote_code in the library’s built-in model code. A reviewer noted that dynamically built arguments could still slip past a static check, so the rule lowers the risk rather than guaranteeing against it.

Timeline

DateEvent
2025-06-26v4.53.0 released, first with LightGlue (no risky path yet)
UnconfirmedReported on huntr (report page did not render)
2026-03-31CVE ID reserved; fix PR #45122 merged
2026-04-02v5.5.0 released with the fix
2026-06-03CVE and GitHub security advisory published
2026-07-13 / 07-21GitHub advisory reviewed / last updated
2026-08-28NVD record last modified
2026-09-01CVE record last updated

The fix was public about two months before the CVE. The v5.5.0 release page summary once showed “April 2, 2025”, but the GitHub API gives 2026-04-02, and the fix was only merged on 2026-03-31, so 2026-04-02 is used here.

Further reading

  • The scores differ widely: NVD gives CVSS 3.1 9.6 (Critical), huntr (the CNA that assigned the CVE) gives CVSS 3.0 8.0, and Red Hat gives CVSS 3.1 7.7 (Red Hat rating “Important”). They disagree on attack complexity (NVD Low, the others High), privileges required (Red Hat Low, the others None) and availability impact (NVD High, the others None). All three require user interaction.
  • Exploitation: no source reports exploitation in the wild, and this CVE is not in CISA KEV. The GitHub advisory listed EPSS (a predicted likelihood of exploitation) at about 0.6% when checked.
  • Reporter: the original huntr report could not be read, so the reporter and report date are unconfirmed.
  • Supply-chain lesson: models behave like code dependencies, and one field in a config file was enough to switch off a safety setting. Exposed environments include inference API servers, research notebooks, CI/CD pipelines and model evaluation workers.

Verification Reviewed and checked against sources; not yet reproduced in our lab

Reviewed2026-09-24

Verification records describe the environment and the result only, never reproduction steps or code that could attack other people’s systems. See our policy.

Sources

  1. Otherv4.54.0 released, first version with PR #39253 · api.github.com · accessed 2026-09-24
  2. AdvisoryArbitrary Code Execution During Model Initialization in LightGlue Model Loading Path (GHSA-fgcw-684q-jj6r) · GitHub Advisory Database, 2026-06-03 · accessed 2026-09-24
  3. AdvisoryCVE-2026-5241 CVE record (JSON API) · CVE Program / huntr (CNA), 2026-06-03 · accessed 2026-09-24
  4. CVE / NVD / OSVCVE-2026-5241 (NVD API) · NIST NVD, 2026-06-03 · accessed 2026-09-24
  5. Patch / release[LightGlue] Remove remote code execution (#45122) · Hugging Face, 2026-03-31 · accessed 2026-09-24
  6. Patch / release🚨 [LightGlue] Remove remote code execution (PR #45122) · Hugging Face, 2026-03-31 · accessed 2026-09-24
  7. VendorRelease v5.5.0 · Hugging Face, 2026-04-02 · accessed 2026-09-24
  8. VendorRelease v5.5.0 (API metadata) · GitHub / Hugging Face, 2026-04-02 · accessed 2026-09-24
  9. AdvisoryCVE-2026-5241 · Red Hat · accessed 2026-09-24
  10. VendorLightGlue documentation · Hugging Face · accessed 2026-09-24
  11. VendorLightGlue documentation (v4.53.3) · Hugging Face · accessed 2026-09-24
  12. VendorRelease v4.53.0 (API metadata) · GitHub / Hugging Face, 2025-06-26 · accessed 2026-09-24

Press brief

In one sentence

Hugging Face Transformers is one of the most widely used Python libraries for downloading and running AI models. Its safety switch, trust_remote_code, blocks code bundled with a model by default, but when loading LightGlue image-matching models, the model's own config file could override that switch. The fixed version, 5.5.0, was released in April 2026 and the CVE was published in June; no source reports exploitation in the wild.

Key facts

Severity (NVD)
CVSS 3.1 9.6 (Critical) services.nvd.nist.gov
Severity (huntr, CNA)
CVSS 3.0 8.0 (High) cveawg.mitre.org
Fixed version
5.5.0 (released 2026-04-02) api.github.com
Fix PR merged
PR #45122, 2026-03-31 github.com
Advisory and CVE published
2026-06-03 (GHSA-fgcw-684q-jj6r) github.com

Confirmed

  • The LightGlue loading path in transformers before 5.5.0 lets model configuration data override the caller's trust_remote_code=False.
  • 5.5.0 fixes it by removing that config field and accepting only built-in detectors.
  • Several Red Hat AI products are listed as affected in the CVE record.

Unconfirmed / disputed

  • The three scores differ widely: NVD 9.6, huntr 8.0, Red Hat 7.7.
  • No official source gives the exact first affected version; a code spot check suggests about 4.54.0.
  • The reporter's identity and report date could not be confirmed (the huntr page did not render).
  • No source reports exploitation in the wild, and it is not in CISA KEV.

Quotable line

A safety switch belongs in the user's hands, not in a config file written by a stranger.

Images

Download the share image (PNG) · Attack flow diagram (downloadable)

Please credit "PlainCVE" and link to this page. Full citation format is under "How to cite" below. Found a factual error? Report it.

How to cite this page

This article is CC BY 4.0. Please keep the attribution and link when republishing.

PlainCVE Team (2026). "Hugging Face Transformers LightGlue loading: a model's config can override trust_remote_code=False and run the model's own code". PlainCVE. https://plaincve.date/en/vulns/cve-2026-5241-transformers-lightglue-remote-code-override (accessed YYYY-MM-DD)
BibTeX
@misc{cve20265241transformerslightglueremotecodeoverride2026,
  title  = {Hugging Face Transformers LightGlue loading: a model's config can override trust_remote_code=False and run the model's own code},
  author = {PlainCVE Team},
  year   = {2026},
  howpublished = {PlainCVE},
  url    = {https://plaincve.date/en/vulns/cve-2026-5241-transformers-lightglue-remote-code-override},
  note   = {Updated 2026-09-24}
}