{"id":"CVE-2026-68770","state":"PUBLISHED","title":"sentence-transformers Arbitrary Code Execution on Local Model Load Despite trust_remote_code=False","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.","publishedAt":"2026-07-31T20:56:06.867Z","updatedAt":"2026-10-08T15:24:17.537Z","severity":{"score":9.3,"label":"Critical","version":"4.0","vector":"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","source":"VulnCheck"},"assigner":"VulnCheck","products":["Hugging Face sentence-transformers"],"affected":[{"vendor":"Hugging Face","product":"sentence-transformers","packageURL":"pkg:pypi/sentence-transformers","defaultStatus":"affected","versions":[{"version":"0","status":"affected","lessThanOrEqual":"5.5.1","versionType":"semver"}]}],"references":["https://github.com/huggingface/sentence-transformers/issues/3801","https://github.com/huggingface/sentence-transformers/pull/3807","https://github.com/huggingface/sentence-transformers","https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a","https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false"],"weaknesses":["CWE-94"],"ingestedAt":"2026-10-29T20:12:49.727Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/68xxx/CVE-2026-68770.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-68770","state":"PUBLISHED","datePublished":"2026-07-31T20:56:06.867Z","dateUpdated":"2026-10-08T15:24:17.537Z","assignerShortName":"VulnCheck","assignerOrgId":"83251b91-4cc7-4094-a5c7-464a1b83ea10","dateReserved":"2026-07-31T16:10:55.448Z"},"containers":{"cna":{"title":"sentence-transformers Arbitrary Code Execution on Local Model Load Despite trust_remote_code=False","descriptions":[{"lang":"en","value":"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":[{"vendor":"Hugging Face","product":"sentence-transformers","packageURL":"pkg:pypi/sentence-transformers","defaultStatus":"affected","versions":[{"version":"0","status":"affected","lessThanOrEqual":"5.5.1","versionType":"semver"}]}],"references":[{"url":"https://github.com/huggingface/sentence-transformers/issues/3801","name":"GitHub Issue","tags":["issue-tracking"]},{"url":"https://github.com/huggingface/sentence-transformers/pull/3807","name":"Pull Request","tags":["vendor-advisory"]},{"url":"https://github.com/huggingface/sentence-transformers","name":"Product Repository","tags":["product"]},{"url":"https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a","name":"Patch Commit","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"]}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"HIGH","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED","version":"4.0","baseSeverity":"CRITICAL","baseScore":9.3,"vectorString":"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"}},{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV3_1":{"attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH","version":"3.1","baseSeverity":"CRITICAL","baseScore":9.8,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-94","lang":"en","description":"Improper Control of Generation of Code ('Code Injection')","type":"CWE"}]}],"providerMetadata":{"shortName":"VulnCheck","orgId":"83251b91-4cc7-4094-a5c7-464a1b83ea10","dateUpdated":"2026-10-08T15:24:17.537Z"},"datePublic":"2026-07-30T00:00:00.000Z","cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:*","versionEndIncluding":"5.5.1"}]}]}],"credits":[{"lang":"en","value":"Bofei Chen","type":"finder"}],"source":{"discovery":"EXTERNAL"},"x_generator":{"engine":"vulncheck-endgame"}},"adp":[{"title":"CISA ADP Vulnrichment","references":[{"url":"https://github.com/huggingface/sentence-transformers/issues/3801","tags":["exploit"]}],"metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-08-03T18:15:42.984440Z","id":"CVE-2026-68770","options":[{"Exploitation":"poc"},{"Automatable":"yes"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-08-03T18:16:01.639Z"}}]}}}