CVE-2026-5241: Policy Bypass in LightGlue Nested Config Resolution in huggingface/transformers

Published Jun 3, 2026
·
Updated

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 trustremotecode 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.frompretrained() with trustremotecode=False, the LightGlueConfig reads the trustremotecode value from the untrusted config.json file and propagates it into nested AutoConfig.frompretrained() 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.

Affected Software

2 affected components
pypi/transformers=5.2.0
huggingface transformers=5.2.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    When loading LightGlue models via AutoModel.from_pretrained(), ensure you do not allow attacker-controlled model repositories/config.json files (e.g., only use trusted local model directories or trusted repositories) so untrusted nested LightGlueConfig/AutoConfig resolution cannot override trust_remote_code behavior.

Event History

Jun 3, 2026
CVE Published
via MITRE·12:33 PM
Data Sourced
via MITRE·12:33 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·02:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·03:02 PM
DescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-5241?

CVE-2026-5241 has a severity rating of high, classified as an 8 on the CVSS scale.

2

How do I fix CVE-2026-5241?

To mitigate CVE-2026-5241, upgrade to the latest version of huggingface/transformers where the vulnerability has been patched.

3

What does CVE-2026-5241 affect?

CVE-2026-5241 affects the LightGlue model loading path in huggingface/transformers version 5.2.0.

4

What is the risk associated with CVE-2026-5241?

The risk associated with CVE-2026-5241 is rated as 58, indicating a significant potential impact on security.

5

What is the nature of the vulnerability in CVE-2026-5241?

CVE-2026-5241 is a policy bypass vulnerability that allows an attacker-controlled model repository to execute arbitrary code.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203