{"id":"CVE-2026-68770","published":"2026-07-31T20:56:06Z","modified":"2026-11-08T14:08:16Z","title":"sentence-transformers Arbitrary Code Execution on Local Model Load Despite trust_remote_code=False","vendor":"Hugging Face","product":"sentence-transformers","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00909,"percentile":0.58016,"provenance":"source"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"references":[{"url":"https://github.com/huggingface/sentence-transformers/issues/3801","tags":["issue-tracking"]},{"url":"https://github.com/huggingface/sentence-transformers/pull/3807","tags":["vendor-advisory","patch"]},{"url":"https://github.com/huggingface/sentence-transformers","tags":["product"]},{"url":"https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a","tags":["patch"]},{"url":"https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false","tags":["third-party-advisory"]}],"priority":{"score":18.5,"factors":[{"name":"EPSS percentile","points":11.6},{"name":"CVSS severity","points":6.86}]},"vendorSlug":"hugging-face","affectedVersions":[{"vendor":"Hugging Face","product":"sentence-transformers","versions":["<= 5.5.1"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2026-08-03T18:15:42.984440Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"sentence-transformers","vulnerableRanges":["<5.6.0"],"patched":["5.6.0"],"from":["GHSA-jhr6-gm9c-rqjv","PYSEC-2026-4164"],"provenance":"source"}],"euvd":{"id":"EUVD-2026-51650","exploited":false,"provenance":"source"}}