CVE-2026-68770
Received Received - Intake

Arbitrary Code Execution in Sentence Transformers via Path Existence Bypass

Vulnerability report for CVE-2026-68770, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-31

Last updated on: 2026-07-31

Assigner: VulnCheck

Description

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-31
Last Modified
2026-07-31
Generated
2026-08-01
AI Q&A
2026-08-01
EPSS Evaluated
N/A
NVD

Affected Vendors & Products

Currently, no data is known.

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-94 The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability is a security control bypass in sentence-transformers that allows arbitrary code execution. It exploits a logic flaw in the import_module_class helper where a guard condition checks if a path exists on the local filesystem. If an attacker can place malicious Python files in a model directory, the code executes when the model is loaded with trust_remote_code=False, bypassing intended security measures.

Detection Guidance

Detecting this vulnerability requires checking for malicious Python files in model directories and verifying the use of vulnerable sentence-transformers versions. Inspect directories where models are loaded for unexpected modeling_*.py files or modules.json references. Check installed sentence-transformers versions with pip show sentence-transformers. Monitor for unusual code execution during model loading processes.

Impact Analysis

If you use sentence-transformers and an attacker can control or influence files in a model directory on your system, they could execute arbitrary code within your application. This could lead to data breaches, system compromise, or further network infiltration, depending on the privileges of the application.

Compliance Impact

This vulnerability could lead to unauthorized code execution, potentially causing data breaches or loss of sensitive information. This may violate compliance requirements under GDPR (data protection), HIPAA (healthcare data), or other regulations that mandate strict access controls and protection of sensitive data.

Mitigation Strategies

Immediately update sentence-transformers to a patched version that removes the flawed import_module_class logic. Avoid using untrusted model paths and ensure trust_remote_code=True is enforced. Audit model directories for suspicious files like modeling_*.py.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-68770. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart