# CVE-2026-68770: sentence-transformers Arbitrary Code Execution on Local Model Load Despite trust_remote_code=False

> CVE-2026-68770: sentence-transformers Arbitrary Code Execution on Local Model Load Despite trust_remote_code=False. CVSS 9.8 (CVSS 3.1).

Canonical: https://rewindex.com/cve/CVE-2026-68770
Last updated: 2026-10-23T23:10:00Z

- Published: 2026-07-31 20:56 UTC · Updated: 2026-10-23 23:10 UTC · Assigner: VulnCheck
- CVSS: 9.8 (CVSS 3.1) · Severity: Critical · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.91%, 60th percentile (scored 2026-10-25)
- CISA KEV: no
- CWE: CWE-94

## 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 vendors and products

- Hugging Face: sentence-transformers

## Tracked companies

- [Hugging Face](https://rewindex.com/company/hugging-face.md)

## References

- [CVE record on cve.org](https://www.cve.org/CVERecord?id=CVE-2026-68770)
- [NVD entry](https://nvd.nist.gov/vuln/detail/CVE-2026-68770)
- [https://github.com/huggingface/sentence-transformers](https://github.com/huggingface/sentence-transformers)
- [https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a](https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a)
- [https://github.com/huggingface/sentence-transformers/issues/3801](https://github.com/huggingface/sentence-transformers/issues/3801)
- [https://github.com/huggingface/sentence-transformers/pull/3807](https://github.com/huggingface/sentence-transformers/pull/3807)
- [https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false](https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false)

---

_Sources: CVE records from the CVE Program (cve.org). CVE® is a registered trademark of The MITRE Corporation. (https://www.cve.org/) This product uses data from the NVD API but is not endorsed or certified by the NVD. (https://nvd.nist.gov/) Known Exploited Vulnerabilities catalog from CISA. (https://www.cisa.gov/known-exploited-vulnerabilities-catalog) EPSS scores from FIRST (Exploit Prediction Scoring System). (https://www.first.org/epss/)_


---
Canonical: https://rewindex.com/cve/CVE-2026-68770 · Markdown: https://rewindex.com/cve/CVE-2026-68770.md · JSON: https://rewindex.com/api/v1/cves/CVE-2026-68770 · Data licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) · Generated 2026-10-26T05:12:10.765Z
