---
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
published: '2026-07-31'
updated: '2026-09-09'
sourceUpdated: '2026-09-09T20:35:08.537'
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
tags:
  - nvd
  - cve.org
  - exploit-available
epss: 0.00909
epssPercentile: 0.58282
ingestedAt: '2026-09-09T21:22:45.520Z'
vendor: Hugging Face
product: sentence-transformers
affected:
  - sentence-transformers <= 5.5.1
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'yes'
  technicalImpact: total
  timestamp: '2026-08-03T18:15:42.984440Z'
---

## 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.
