Junglewise Threat Intelligence

CVE-2026-5241: Hugging Face Transformers RCE in LightGlue model loading

CVE-2026-5241 · Severity: high · CVSS 8 · Published 2026-06-03

Executive brief

A security flaw in the Hugging Face Transformers library allows a malicious AI model to execute unauthorized code on a user's computer. This occurs even if the user has explicitly disabled the setting that allows remote code execution. An attacker could use this to steal credentials, gain a foothold in a corporate network, or disrupt automated AI pipelines.

Technical details

A vulnerability in the LightGlue model loading path of huggingface/transformers (specifically version 5.2.0 and others before 5.5.0) allows for arbitrary code execution. The root cause is a failure to properly enforce the 'trust_remote_code' security parameter. When a user loads a LightGlue model via 'AutoModel.from_pretrained()' with 'trust_remote_code=False', the 'LightGlueConfig' component incorrectly reads a 'trust_remote_code' value from the untrusted 'config.json' file within the model repository. This value is then propagated into nested 'AutoConfig.from_pretrained()' calls, overriding the user's safety preference and executing attacker-supplied Python modules. This can be exploited if a user is enticed to load a malicious model from a remote repository.

Affected products

  • Hugging Face transformers < 5.5.0

Timeline

  • 2026-03-31: patched: Fix committed to repository
  • 2026-06-03: disclosed: Initial advisory publication
  • 2026-07-13: advisory: Advisory updated and reviewed

References

Related threats