---
id: CVE-2026-68770
title: >-
  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, wher…
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, wher…
severity: critical
cvss: 9.8
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'
cwe:
  - CWE-94
  - CWE-454
vendor: Hugging Face
product: sentence-transformers
affected:
  - sentence-transformers <= 5.5.1
patched:
  - sentence-transformers 5.6.0
published: '2026-07-31'
updated: '2026-10-08'
sourceUpdated: '2026-10-08T16:17:33.050'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-68770'
references:
  - url: 'https://github.com/huggingface/sentence-transformers'
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/huggingface/sentence-transformers/commit/ae1acc3fb2aa2004577b297eb4a915ce7a03316a
    label: disclosure@vulncheck.com
  - url: 'https://github.com/huggingface/sentence-transformers/issues/3801'
    label: disclosure@vulncheck.com
  - url: 'https://github.com/huggingface/sentence-transformers/pull/3807'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/sentence-transformers-arbitrary-code-execution-on-local-model-load-despite-trust-remote-code-false
    label: disclosure@vulncheck.com
  - url: 'https://github.com/huggingface/sentence-transformers/issues/3801'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-68770'
  - url: 'https://github.com/huggingface/sentence-transformers/pull/3935'
  - url: >-
      https://github.com/huggingface/sentence-transformers/commit/626eb602b088878a8173bcab69225f68411b99e1
  - url: 'https://github.com/huggingface/sentence-transformers/releases/tag/v5.6.0'
  - url: 'https://github.com/huggingface/sentence-transformers/releases/tag/v6.0.0'
  - url: 'https://github.com/advisories/GHSA-jhr6-gm9c-rqjv'
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-68770.json
  - url: 'https://access.redhat.com/security/cve/CVE-2026-68770'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2509932'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-68770'
  - url: 'https://access.redhat.com/errata/RHSA-2026:73987'
  - url: 'https://pypi.org/project/sentence-transformers'
  - url: 'https://access.redhat.com/errata/RHSA-2026:84734'
tags:
  - nvd
  - cve.org
  - exploit-available
  - ghsa
  - pip
  - osv
  - csaf
  - vex
  - red-hat
  - score-dispute
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'yes'
  technicalImpact: total
  timestamp: '2026-08-03T18:15:42.984440Z'
epss: 0.00909
epssPercentile: 0.59771
aliases:
  - GHSA-jhr6-gm9c-rqjv
  - PYSEC-2026-4164
ecosystem: pip
scores:
  nvd: 9.8
  vendor: 7.4
  osv: 9.8
ingestedAt: '2026-09-09T21:22:45.520Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-68770)

Affected packages:

- `sentence-transformers < 5.6.0`

Patched in:

- `sentence-transformers 5.6.0`

Source: https://github.com/advisories/GHSA-jhr6-gm9c-rqjv

## Vendor advisories

- **RHSA-2026:73987** · Red Hat · fixed in: Red Hat OpenShift AI 3.3 · released 2026-09-30 · [advisory](https://access.redhat.com/errata/RHSA-2026:73987)
- **Red Hat VEX** · Important · affected: Lightspeed Core, OpenShift Lightspeed, Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux AI (RHEL AI) 3, Red Hat OpenShift AI (RHOAI) · no fix planned: Red Hat Ansible Automation Platform 2, Red Hat Enterprise Linux AI (RHEL AI) 3, Lightspeed Core, OpenShift Lightspeed, … · updated 2026-10-19 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-68770.json)
- **RHSA-2026:84734** · Red Hat · fixed in: Red Hat OpenShift AI 3.4 · released 2026-10-19 · [advisory](https://access.redhat.com/errata/RHSA-2026:84734)
