Arbitrary Code Injection Affecting sentence-transformers package, versions [,5.6.0)


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.52% (42nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Arbitrary Code Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-SENTENCETRANSFORMERS-18507657
  • published2 Aug 2026
  • disclosed31 Jul 2026
  • creditBofei Chen

Introduced: 31 Jul 2026

NewCVE-2026-68770  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade sentence-transformers to version 5.6.0 or higher.

Overview

sentence-transformers is a State-of-the-Art Text Embeddings

Affected versions of this package are vulnerable to Arbitrary Code Injection through the import_module_class function in sentence_transformers/util/misc.py due to a logic flaw that allows the security guard to be bypassed if a local path exists. An attacker can execute arbitrary code by placing malicious Python files in a model directory and influencing the loading process, even when the security flag is set to prevent such execution.

CVSS Base Scores

version 4.0
version 3.1