CVE-2026-68770
CRITICAL 9.3CVSS 4.0sentence-transformers local model loading bypasses trust_remote_code and executes custom Python
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.
- Published
- 31 Jul 2026
- Last modified
- 23 Oct 2026
- Assigned by
- disclosure@vulncheck.com
- NVD status
- Deferred
- Weakness
- CWE-94
- Also known as
- GHSA-jhr6-gm9c-rqjvPYSEC-2026-4164
- Sources
- NVDJSONOSV GHSA-jhr6-gm9c-rqjvJSONOSV PYSEC-2026-4164JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | disclosure@vulncheck.com (Secondary) | CVSS 4.0 | CRITICAL 9.3 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X |
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N | |
| OSV | PyPA | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N | |
| NVD | disclosure@vulncheck.com (Secondary) | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | CRITICAL 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| OSV | PyPI | sentence-transformers | < 5.6.0 | 5.6.0 |
References
- https://github.com/huggingface/sentence-transformers · PACKAGE
- https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a · WEB
- https://github.com/huggingface/sentence-transformers/issues/3801 · WEB
- https://github.com/huggingface/sentence-transformers/pull/3807 · WEB
- https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false · WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-68770 · ADVISORY
- https://github.com/huggingface/sentence-transformers/pull/3935 · WEB
- https://github.com/huggingface/sentence-transformers/commit/626eb602b088878a8173bcab69225f68411b99e1 · WEB
- https://github.com/huggingface/sentence-transformers/releases/tag/v5.6.0 · WEB
- https://github.com/huggingface/sentence-transformers/releases/tag/v6.0.0 · WEB
- https://pypi.org/project/sentence-transformers · PACKAGE
- https://github.com/advisories/GHSA-jhr6-gm9c-rqjv · ADVISORY
History
- 25 Nov 2026 21:04 UTC · NVD: first stored (published 31 Jul 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 1 Oct 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 31 Jul 2026)