CVE-2026-68770

Hugging Face · sentence-transformers

A logic flaw in the sentence-transformers library allows attackers to bypass security checks and achieve arbitrary code execution by loading malicious local models.

Executive summary

A critical security control bypass in sentence-transformers allows for arbitrary code execution when loading local models, regardless of security settings.

Vulnerability

The vulnerability exists in the import_module_class helper where an incorrect guard condition allows the execution of arbitrary Python code from a local directory. This occurs even when the trust_remote_code argument is set to False, provided the attacker can influence local file contents.

Business impact

Successful exploitation allows an attacker to achieve code execution within the process space of the application using the library. This could lead to full system compromise, data exfiltration, or unauthorized access to sensitive environments, meriting its critical severity status.

Remediation

Immediate Action: Update the sentence-transformers library to the latest available version that addresses this logic flaw.

Proactive Monitoring: Monitor file system activity for unexpected creation or modification of modeling_*.py files in model directories.

Compensating Controls: Enforce strict file system permissions on model storage locations and ensure that only trusted, verified models are loaded by the application.

Exploitation status

Public Exploit Available: Unknown

Analyst recommendation

Because this vulnerability invalidates a core security guarantee of the library, users should prioritize updating their dependencies immediately. Ensure that all production environments are running the patched version to prevent potential remote code execution scenarios.