---
schema_version: '1.0'
id: security-20261001-9c57d0
title: 'CVE-2026-68770: sentence-transformers local model loading bypasses trust_remote_code
  and executes custom Python'
url: https://osv.dev/vulnerability/GHSA-jhr6-gm9c-rqjv
url_hash: 9c57d031b49a6ed972f5e612cea01d26c844027e10552484e0058489b07a5da3
canonical_url: https://osv.dev/vulnerability/GHSA-jhr6-gm9c-rqjv
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-68770
- GHSA-jhr6-gm9c-rqjv
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- sentence-transformers
- PyPI
lang: en
published_at: '2026-07-31T21:31:59Z'
fetched_at: '2026-10-01T03:59:10.012176Z'
updated_at: '2026-10-01T05:38:51Z'
status: published
content_hash: e4816a6b58680f5589fbbbfb2e00ba9aae92c671cba436e2042771043cc3989a
content_changed_at: null
license_note: full
summary: sentence-transformers local model loading bypasses trust_remote_code and
  executes custom Python
summary_source: rss
summary_en: sentence-transformers local model loading bypasses trust_remote_code and
  executes custom Python
summary_omitted_reason: null
redistribution: true
keywords_en:
- and
- bypasses
- custom
- CVE
- CVE-2026-68770
- executes
- GHSA-jhr6-gm9c-rqjv
- library vulnerability
- loading
- local
- model
- model_blowout_study
- PyPI
- Python
- sentence-transformers
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- software security
- trust_remote_code
entities_en:
- name: CVE
  type: data
- name: model_blowout_study
  type: event
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: CVE
  type: data
- name: model_blowout_study
  type: event
key_facts: []
related: []
related_auto: []
computed_at: '2026-10-01T05:38:43Z'
---

# CVE-2026-68770: sentence-transformers local model loading bypasses trust_remote_code and executes custom Python

## TL;DR
sentence-transformers local model loading bypasses trust_remote_code and executes custom Python

## Key Points
- cve / CVE-2026-68770 / GHSA-jhr6-gm9c-rqjv / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H / sentence-transformers / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
**Advisory:** GHSA-jhr6-gm9c-rqjv (CVE-2026-68770)

**Details:**
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.

**References:**
- https://nvd.nist.gov/vuln/detail/CVE-2026-68770
- https://github.com/huggingface/sentence-transformers/issues/3801
- https://github.com/huggingface/sentence-transformers/pull/3807
- https://github.com/huggingface/sentence-transformers/pull/3935
- https://github.com/huggingface/sentence-transformers/commit/626eb602b088878a8173bcab69225f68411b99e1
- https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a
- https://github.com/huggingface/sentence-transformers
- https://github.com/huggingface/sentence-transformers/releases/tag/v5.6.0
- https://github.com/huggingface/sentence-transformers/releases/tag/v6.0.0
- https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-jhr6-gm9c-rqjv_

## Source
元記事: [CVE-2026-68770: sentence-transformers local model loading bypasses trust_remote_code and executes custom Python](https://osv.dev/vulnerability/GHSA-jhr6-gm9c-rqjv) — published 2026-07-31T21:31:59Z
