Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-68770: Improper Control of Generation of Code ('Code Injection') in Hugging Face sentence-transformers

0
Critical
VulnerabilityCVE-2026-68770cvecve-2026-68770
Published: 07/31/2026 (07/31/2026, 20:56:06 UTC)
Source: CVE Database V5
Vendor/Project: Hugging Face
Product: sentence-transformers

Description

A critical code injection vulnerability exists in the Hugging Face sentence-transformers library due to improper control in the import_module_class helper. This flaw allows attackers to bypass the trust_remote_code=False security setting by exploiting a logic condition that trusts any existing local model path. Malicious Python files placed in a model directory can be executed during model loading, leading to arbitrary code execution. No patch or official remediation guidance is currently provided.

CVSS v4.0

Score 9.3critical

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
High
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

sentence-transformers
pkg:pypi/sentence-transformers
Affected versions
*

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/31/2026, 21:33:41 UTC

Technical Analysis

CVE-2026-68770 describes a security control bypass vulnerability in the Hugging Face sentence-transformers library. The issue arises from a logic flaw in the import_module_class helper function within sentence_transformers/util/misc.py. Specifically, the guard condition includes an 'or os.path.exists(model_name_or_path)' clause that causes the trust gate to be satisfied whenever the supplied model path exists locally, regardless of the trust_remote_code=False argument. Attackers who can influence the contents of a local model directory can place malicious Python files (e.g., modeling_*.py referenced via modules.json) that are imported and executed during model loading. This results in arbitrary code execution within the context of the application loading the model, violating the intended security restrictions.

Potential Impact

Successful exploitation allows an attacker with the ability to control or influence files in a local model directory to execute arbitrary Python code during model loading. This bypasses the documented security control that should prevent remote code execution when trust_remote_code is set to false. The vulnerability has a CVSS 4.0 score of 9.3 (critical), indicating high impact with network attack vector, no privileges required, and no user interaction needed.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is released, users should avoid loading models from untrusted or user-controlled local directories with trust_remote_code set to false, as this setting is bypassed by the vulnerability. Monitor official Hugging Face communications for updates and apply any forthcoming patches promptly.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
VulnCheck
Date Reserved
2026-07-31T16:10:55.448Z
Cvss Version
4.0
State
PUBLISHED
Remediation Level
null

Threat ID: 6a6d131bbf32cb7a3452db5b

Added to database: 07/31/2026, 21:26:51 UTC

Last enriched: 07/31/2026, 21:33:41 UTC

Last updated: 07/31/2026, 21:57:04 UTC

Views: 3

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses