cve.bz

CVE-2026-68770 hugging face sentence-transformers: Code Injection

9.3 criticalEPSS 0.9%Fix available

Critical (9.3) in hugging face sentence-transformers. EPSS 0.9% estimated probability of exploitation activity in the next 30 days. Fixed in sentence-transformers 5.6.0.

On this page
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.

Severity

CVSS 4.0

9.3 critical
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
0.9% (unchanged from 0.9% a week ago; 0.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 61st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: yes · Technical impact: total, assessed 2026-08-03. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-94 Improper Control of Generation of Code (Code Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

  • sentence-transformers (PyPI): fixed in 5.6.0

Ask an AI about this CVE

Show the promptExplain CVE-2026-68770 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-68770?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-68770?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-68770 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Hugging Face sentence-transformersthrough 5.5.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-jhr6-gm9c-rqjvPyPIsentence-transformers<5.6.05.6.0
PYSEC-2026-4164PyPIsentence-transformers<5.6.05.6.0

Red Hat

Red Hat rates this Important.

Red Hat's statement

A remote code execution vulnerability was found in the sentence-transformers library. The import_module_class() function bypasses the trust_remote_code=False security check when loading models from a local file path. If a model's modules.json references a class outside the sentence_transformers.* namespace, arbitrary code execution can occur when the model is loaded.

Red Hat rates this flaw as Important rather than the upstream Critical and AV:L/AC:H because exploitation requires the attacker to first gain local access to place a malicious model on the target system's filesystem.

Red Hat's mitigation

Red Hat has investigated whether a possible mitigation exists for this issue, and has not been able to identify a practical example. Please update the affected package as soon as possible.

Note: sentence-transformers 5.6.0 does NOT fix this vulnerability (it only adds a deprecation warning). The fix is planned for version 6.0.

ProductPackageStateAdvisory
Red Hat OpenShift AI 2.25rhoai/odh-caikit-nlp-rhel9:1791448212Fixed 2026-10-21RHSA-2026:87410
Red Hat OpenShift AI 3.3rhoai/odh-trustyai-nemo-guardrails-server-rhel9:1789570674Fixed 2026-09-30RHSA-2026:73987
Red Hat OpenShift AI 3.4rhoai/odh-trustyai-nemo-guardrails-server-rhel9:1791556128Fixed 2026-10-19RHSA-2026:84734
Lightspeed Corelightspeed-core/lightspeed-stack-rhel9Affected
Lightspeed Corelightspeed-core/rag-tool-cpu-rhel9Affected
Lightspeed Corelightspeed-core/rag-tool-cuda-12.9-rhel9Affected
OpenShift Lightspeedopenshift-lightspeed/lightspeed-ocp-rag-rhel9Not affected
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Affected
OpenShift Lightspeedopenshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9Not affected
Red Hat Ansible Automation Platform 2ansible-automation-platform-25/lightspeed-chatbot-rhel8Will not fix
Red Hat Ansible Automation Platform 2ansible-automation-platform-26/lightspeed-chatbot-rhel9Will not fix
Red Hat Ansible Automation Platform 2ansible-automation-platform-27/lightspeed-chatbot-rhel9Will not fix
Red Hat Enterprise Linux AI (RHEL AI) 3rhelai3/bootc-cuda-rhel9Affected
Red Hat Enterprise Linux AI (RHEL AI) 3rhelai3/bootc-gaudi-rhel9Will not fix
Red Hat Enterprise Linux AI (RHEL AI) 3rhelai3/bootc-rocm-rhel9Affected
Red Hat Enterprise Linux AI (RHEL AI) 3rhelai3/disk-image-cuda-rhel9Affected
Red Hat OpenShift AI (RHOAI)rhoai/odh-caikit-tgis-serving-rhel9Not affected
Red Hat OpenShift AI (RHOAI)rhoai/odh-llama-stack-core-rhel9Not affected
Red Hat OpenShift AI (RHOAI)rhoai/odh-openvino-model-server-rhel9Affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-68770.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON