Arbitrary Code Execution via Local Model Trust Bypass in sentence-transformers
CVE-2026-68770 is a security control bypass in sentence-transformers affecting versions up to and including 5.5.1. The import_module_class helper incorrectly treats the existence of a local model path as sufficient authorization to import custom Python code, even when trust_remote_code=False. An attacker who controls or influences a local model directory can supply malicious Python modules referenced by the model configuration. Loading the model executes the attacker-controlled code at import time within the loading process, bypassing the documented trust restriction.
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
Successful exploitation compromises the confidentiality, integrity, and availability of the model-loading application within its execution privileges. Attacker-controlled code can access application data and credentials, modify accessible resources, or disrupt the service. Further system compromise or lateral movement depends on the permissions, credentials, and network access available to the application.
If you can’t patch tonight, do this now.
Until upgraded, avoid loading models from directories writable by untrusted users or processes. Restrict write access to model directories, caches, and shared storage; obtain models only from trusted sources and verify their integrity before loading. Validate model contents and isolate model-loading workloads using least-privilege accounts and sandboxing where feasible. Do not rely on trust_remote_code=False to prevent custom-code execution from local model paths in affected versions.
Patch, then assume compromise.
Upgrade sentence-transformers to version 5.6.1 or a later security-fixed release. Fixed-version information differs: one advisory identifies 5.6.0 as the first fixed version, while another identifies 5.6.1. Using 5.6.1 or later avoids that discrepancy. Inventory deployments and update environments that load models from local directories.
No public exploits tracked yet. Mallory keeps watching.
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
12 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.