Security Digest · Vulnerability record

CVE-2026-68770: sentence-transformers local model loading bypasses trust_remote_code and executes custom Python

sentence-transformers contains a security control bypass vulnerability that allows attackers to achieve arbitrary code execution by exploiting a logic flaw in the importmoduleclass helper within sentencetransformers/util/misc.py, where the guard condition includes an 'or os.path.exists(modelnameorpath)' clause that…

CVSS 9.3 Critical EPSS 0.9% · p60

Should you act?

Critical and remotely reachable

No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • Not in CISA KEV, but CISA’s SSVC assessment records a public proof-of-concept, so attack code exists.
  • EPSS 0.9%, percentile 60: FIRST’s model estimates a 0.9% chance of exploitation activity in the next 30 days, higher than 60% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
  • Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
  • Only applies if your dependency tree includes sentence-transformers (PyPI) < 5.6.0, fixed in 5.6.0. Check your lockfile, including transitive dependencies.

What it is

sentence-transformers contains a security control bypass vulnerability that allows attackers to achieve arbitrary code execution by exploiting a logic flaw in the importmoduleclass helper within sentencetransformers/util/misc.py, where the guard condition includes an 'or os.path.exists(modelnameorpath)' clause that satisfies the trust gate whenever the supplied path exists on the local filesystem, regardless of the trustremotecode=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, trustremotecode=False), bypassing the documented security contract and achieving code execution within the loading process.

From the GitHub advisory

sentence-transformers contains a security control bypass vulnerability that allows attackers to achieve arbitrary code execution by exploiting a logic flaw in the importmoduleclass helper within sentencetransformers/util/misc.py, where the guard condition includes an 'or os.path.exists(modelnameorpath)' clause that satisfies the trust gate whenever the supplied path exists on the local filesystem, regardless of the trustremotecode=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, trustremotecode=False), bypassing the documented security contract and achieving code execution within the loading process.

Weakness type: CWE-94.

Product: sentence-transformers (PyPI) · Assigned by: VulnCheck · Published: 2026-07-31

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
PyPIsentence-transformers< 5.6.05.6.0
VendorProductAffected versions (per CVE record)
Hugging Facesentence-transformers<= 5.5.1

Severity scores

Scored byCVSSScoreVector
VulnCheck4.09.3 CriticalCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
VulnCheck3.19.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GitHub4.09.3 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
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Attack requirements: none
  • Privileges required: none (no login)
  • User interaction: none

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation poc, automatable yes, technical impact total.
  • FIRST EPSS (model of 2026-10-21): 0.91% probability of exploitation activity in the next 30 days; percentile 60.

Timeline

  • — CVE record published by VulnCheck
  • — GitHub-reviewed advisory GHSA-jhr6-gm9c-rqjv published (critical)
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vendor and project advisories, patches

  1. Pull Request github.com
  2. Patch Commit github.com

Vulnerability records

  1. GitHub Advisory GHSA-jhr6-gm9c-rqjv github.com
  2. CVE.org record CVE-2026-68770 cve.org
  3. NVD entry CVE-2026-68770 nvd.nist.gov

Other references from the CVE record and advisory

  1. GitHub Issue github.com
  2. Product Repository github.com
  3. vulncheck.com vulncheck.com
  4. github.com github.com
  5. github.com github.com
  6. github.com github.com
  7. github.com github.com

Critical PyPI advisories · Today’s Security Digest