CVE-2026-68770
sentence-transformers Arbitrary Code Execution on Local Model Load Despite trust_remote_code=False
Also known as GHSA-jhr6-gm9c-rqjv, PYSEC-2026-4164
Mitigation
- Upgrade sentence-transformers to 5.6.0 or later.
Who should check
- Projects that depend on PyPI package sentence-transformers (< 5.6.0)
- Anyone running Hugging Face sentence-transformers <= 5.5.1
Vulnerability facts
- Affected
- sentence-transformers < 5.6.0
- Fixed in
- 5.6.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- Yes: see the exploit references below
- Remote exploitation
- Remote, no login needed
- CVSS
- 9.3 (v4.0, CNA)CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Attack requirements: None
- Privileges required: None
- User interaction: None
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- Confidentiality impact on other systems: None
- Integrity impact on other systems: None
- Availability impact on other systems: None
- EPSS
- 0.91% chance of exploitation in 30 days (percentile 58, 2026-11-26)
- CWE
- CWE-94
- Modified
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| PyPI sentence-transformers | < 5.6.0 | 5.6.0 | osv |
| Hugging Face sentence-transformers | <= 5.5.1 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-68770. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-68770.md Affected: sentence-transformers < 5.6.0 Fixed in: 5.6.0 Steps: 1. Search this machine and project for sentence-transformers (PyPI), Hugging Face sentence-transformers: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
- https://github.com/huggingface/sentence-transformers/pull/3807
- https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a
- https://github.com/huggingface/sentence-transformers/pull/3935
- https://github.com/huggingface/sentence-transformers/commit/626eb602b088878a8173bcab69225f68411b99e1
Exploits and PoCs
Other
- https://github.com/huggingface/sentence-transformers
- https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false
- https://github.com/huggingface/sentence-transformers/releases/tag/v5.6.0
- https://github.com/huggingface/sentence-transformers/releases/tag/v6.0.0
- https://pypi.org/project/sentence-transformers
FAQ
Is CVE-2026-68770 being exploited?
There is no confirmed exploitation: CVE-2026-68770 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 0.91% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2026-68770?
Critical: CVSS 9.3 (v4.0, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2026-68770?
sentence-transformers < 5.6.0.
Is there a fix for CVE-2026-68770?
Yes. Fixed in 5.6.0. Upgrade sentence-transformers to 5.6.0 or later.
How do I check if I'm affected by CVE-2026-68770?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.