Loading...
Skip to main content

CVE-2026-68770 — Vulnerability in sentence-transformers — CVE Details

CRITICAL

sentence-transformers local model loading bypasses trust_remote_code and executes custom Python

Published July 31, 2026Updated October 1, 2026Source: osv

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.

Advisory Timeline

  • First published July 31, 2026 (73 days ago).
  • Last revised October 1, 2026 — 62 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

pip
Update sentence-transformers to 5.6.0 or later
pip install "sentence-transformers>=5.6.0"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: pypi (1).

PackageEcosystemAffectedFixed In
sentence-transformers
pypi
0.1.0, 0.2.0, 0.2.1, 0.2.2 (+74 more)5.6.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2026-68770?
sentence-transformers local model loading bypasses trust_remote_code and executes custom Python This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2026-68770?
CVE-2026-68770 affects sentence-transformers. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-68770 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-jhr6-gm9c-rqjv
PYSEC-2026-4164

Related CVEs

  • CVE-2026-61447
    CRITICAL

    PraisonAI: CodeAgent Executes LLM-Generated Code Without Sandboxing and Leaks All Environment Secrets

  • CVE-2026-61445
    CRITICAL

    PraisonAI: AICoder Arbitrary File Write and Command Execution via LLM Tool Calls

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies