{"id":"CVE-2026-68770","aliases":["CVE-2026-68770","GHSA-jhr6-gm9c-rqjv","PYSEC-2026-4164"],"related":[],"kind":"vulnerability","state":"published","title":"sentence-transformers Arbitrary Code Execution on Local Model Load Despite trust_remote_code=False","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"es","text":"sentence-transformers contiene una vulnerabilidad de omisión de control de seguridad que permite a los atacantes lograr ejecución de código arbitrario al explotar un fallo lógico en la función auxiliar import_module_class dentro de sentence_transformers/util/misc.py, donde la condición de guardia incluye una cláusula ’or os.path.exists(model_name_or_path)’ que satisface la puerta de confianza siempre que la ruta proporcionada existe en el sistema de archivos local, independientemente del argumento trust_remote_code=False. Los atacantes que pueden controlar o influir en el contenido de un directorio de modelo en disco pueden colocar archivos Python maliciosos como modeling_*.py referenciados a través de modules.json, haciendo que el código se ejecute en el momento de la importación cuando una aplicación carga el modelo con SentenceTransformer(path, trust_remote_code=False), omitiendo el contrato de seguridad documentado y logrando la ejecución de código dentro del proceso de carga.","source":"nvd"}],"published":"2026-07-31T20:56:06.867Z","modified":"2026-11-08T14:08:16.653Z","severity":{"scorer":"VulnCheck","scheme":"CVSS: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","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS: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","score":9.3,"rating":"CRITICAL"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS: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","rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS: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"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"type":"semver","introduced":"0","lastAffected":"5.5.1","status":"affected"}],"vendor":"Hugging Face","product":"sentence-transformers","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.6.0"}],"ecosystem":"PyPI","package":"sentence-transformers","purl":"pkg:pypi/sentence-transformers","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.6.0"}],"ecosystem":"PyPI","package":"sentence-transformers","purl":"pkg:pypi/sentence-transformers","source":"pysec"}],"references":[{"url":"https://github.com/huggingface/sentence-transformers/issues/3801","tags":["exploit","issue-tracking","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/huggingface/sentence-transformers/pull/3807","tags":["patch","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/huggingface/sentence-transformers","tags":["package","product"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a","tags":["patch","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-68770","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/huggingface/sentence-transformers/pull/3935","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/huggingface/sentence-transformers/commit/626eb602b088878a8173bcab69225f68411b99e1","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/huggingface/sentence-transformers/releases/tag/v5.6.0","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/huggingface/sentence-transformers/releases/tag/v6.0.0","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/sentence-transformers","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-jhr6-gm9c-rqjv","tags":["advisory"],"sources":["pysec"]}],"credits":["Bofei Chen"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-08-03T18:15:42.984Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-68770","url":"https://www.cve.org/CVERecord?id=CVE-2026-68770","licence":"CVE Terms of Use","modified":"2026-11-08T14:08:16.653Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-jhr6-gm9c-rqjv","url":"https://github.com/advisories/GHSA-jhr6-gm9c-rqjv","licence":"CC-BY-4.0","modified":"2026-10-01T17:55:41.036Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-68770","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-68770","licence":"Public domain","modified":"2026-10-23T23:10:00.157Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-4164","url":"https://osv.dev/vulnerability/PYSEC-2026-4164","licence":"CC-BY-4.0","modified":"2026-10-01T17:45:16.845Z"}],"updatedAt":"2026-11-25T22:59:30.741Z","epss":{"score":0.00647,"percentile":0.52346,"date":"2026-12-01T12:00:22.000Z"}}