CVE-2026-68770 Details
Description
sentence-transformers contains a security control bypass vulnerability that allows attackers to achieve arbitrary code execution by exploiting a logic flaw in the import_module_class helper within sentence_transformers/util/misc.py, where the guard condition includes an 'or os.path.exists(model_name_or_path)' clause that satisfies the trust gate whenever the supplied path exists on the local filesystem, regardless of the trust_remote_code=False argument. Attackers who can control or influence the contents of a model directory on disk can place malicious Python files such as modeling_*.py referenced via modules.json, causing the code to execute at import time when an application loads the model with SentenceTransformer(path, trust_remote_code=False), bypassing the documented security contract and achieving code execution within the loading process.
A security control bypass vulnerability has been identified in Hugging Face's Sentence-Transformers library, specifically in versions through 5.5.1. This vulnerability allows for arbitrary code execution by exploiting a logic flaw in the 'import_module_class' function within 'sentence_transformers/util/misc.py'. The issue arises because the guard condition includes an 'or os.path.exists(model_name_or_path)' clause, which bypasses the 'trust_remote_code=False' argument. When a model is loaded from a local path, the library can execute malicious Python files placed in the model directory, exploiting the trust gate and executing the code during the model loading process.
Users are advised to update to Sentence-Transformers version 5.6.1 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Jul 31, 2026CISA-ADP
Assessed Aug 3, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/huggingface/sentence-transformers/issues/3801 | CISA-ADP | ExploitIssue TrackingTechnical DescriptionVendor |
| https://github.com/huggingface/sentence-transformers | [email protected] | Vendor |
| https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a | [email protected] | Source CodeVendor |
| https://github.com/huggingface/sentence-transformers/issues/3801 | [email protected] | ExploitIssue TrackingTechnical DescriptionVendor |
| https://github.com/huggingface/sentence-transformers/pull/3807 | [email protected] | Issue TrackingVendor |
| https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false | [email protected] | AdvisoryRemedy |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-94 | Improper Control of Generation of Code ('Code Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| sentence-transformers | <= 5.5.1 (semver) |
CPE
Remediation
| |
Change History
2 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 3, 2026 | CVE Modified | CISA-ADP |
| Jul 31, 2026 | New CVE Received | [email protected] |
Volerion