Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPublish malicious Hugging Face model repo
-
DeliveryVictim calls use_hf_model on that repo
-
ExploitUnsandboxed jinja2 renders crafted chat_template
-
ExecutionTemplate payload reaches os module
-
ImpactExecute arbitrary commands as victim process
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V1 - Encoding and Sanitization Template injection prevention
|
| Exploitation Conditions | Exploitation requires that a victim application using languagemodels 1.0.0 call Config.use_hf_model with a Hugging Face model path/revision that the attacker controls (or has compromised), and that the attacker-supplied tokenizer_config.json contain a crafted chat_template. The root condition is that version 1.0.0 builds the jinja2 rendering context with a non-sandboxed Environment(loader=BaseLoader()), allowing template expressions to reach the os module. Limiting factors: the attack is not remote-unauthenticated against a default configuration - it depends on the victim choosing to load an untrusted/attacker-controlled model (UI:P, local trigger), so deployments that load only trusted first-party models are not exposed. Updating to 1.0.1, which uses ImmutableSandboxedEnvironment, is the fix the evidence states. |
| Impact | Signals are mixed and point to a serious-but-not-mass-exploitation issue. The CVSS 4.0 base score of 8.5 (High) reflects full code execution (VC:H/VI:H/VA:H), but the vector itself tempers urgency: AV:L means the flaw is not reached by an unsolicited network request, and UI:P means a victim action is required - specifically loading an attacker-controlled Hugging Face model. There is no EPSS score and no KEV listing in the provided data, and no reference is labeled as confirmed working exploit code, so there is no evidence of active or automated exploitation. The vuln.today decision label is 'this_week' (not act_now or emergency), consistent with a real but prioritizable issue rather than a drop-everything emergency. The dominant risk is supply-chain/trust-boundary in nature: any workflow that loads untrusted third-party models through Config.use_hf_model in version 1.0.0 is exposed to RCE, but default use against trusted models is not automatically affected. Net: a genuine RCE worth patching promptly, but its real-world blast radius is limited by the local vector, required user interaction, and the niche footprint of the affected library rather than being a widespread internet-facing threat. |
| Exploit ScenarioDerived | An attacker publishes or compromises a Hugging Face model repository and plants a malicious Jinja2 chat_template inside tokenizer_config.json. When a victim running languagemodels 1.0.0 loads that model via Config.use_hf_model, the unsandboxed jinja2 environment renders the template, reaches the os module, and runs arbitrary commands with the victim process's privileges. No confirmed working exploit code is identified in the provided sources, though a VulnCheck advisory describing the flaw exists. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 30, 2026
Template injection in the Python languagemodels library 1.0.0 lets an attacker who controls a Hugging Face model repository run arbitrary commands inside the victim's Python process: the crafted chat_template shipped in tokenizer_config.json is rendered by an unsandboxed jinja2 Environment(loader=BaseLoader()) in Config.use_hf_model, so template expressions can reach the os module and execute with the privileges of the loading process. Only applications that call use_hf_model against an untrusted or compromised model path/revision are exposed, and the trigger requires the victim to load that model (user interaction), so deployments restricted to trusted first-party models are not affected. There is no public exploit identified at time of analysis and no confirmed active exploitation; the upstream project addressed the flaw in version 1.0.1 by switching to ImmutableSandboxedEnvironment. Severity is high (CVSS 8.5 from the reporting source; an assessed CVSS:3.1 vector of AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H reflects the local trigger and required user action), and the priority signal places remediation in the this-week window rather than immediate emergency response.
RemediationAI
Vendor-released patch: languagemodels 1.0.1 - upgrade from 1.0.0 to 1.0.1 (https://pypi.org/project/languagemodels/1.0.1/), which applies the fix in commit 48f4257a0d20a82075d2847a51036a3c8a2a0a13, tracked in issue 43 and PR 44 (https://github.com/jncraton/languagemodels/pull/44), and is the remediation the evidence states. The change replaces jinja2.Environment(loader=BaseLoader()) in Config.use_hf_model with jinja2.sandbox.ImmutableSandboxedEnvironment(loader=BaseLoader()); if an upgrade cannot be scheduled immediately, applying that same substitution locally carries the trade-off that the sandbox restricts what templates may do, so unusual or complex chat_template constructs that a non-sandboxed environment tolerated may fail to render. Because exploitation depends on the victim loading an attacker-controlled model repository, an additional containment step consistent with the reported conditions is to restrict use_hf_model to trusted first-party model paths and revisions and to inspect tokenizer_config.json for the chat_template field before loading an unfamiliar model - with the caveat that manual template review is error-prone and does not replace updating to 1.0.1. The advisory at https://www.vulncheck.com/advisories/languagemodels-1.0.0-jinja2-template-injection-rce-via-config-use-hf-model documents the issue for change-tracking purposes.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
languagemodels is a Python package for running small language models locally. Hugging Face tokenizer configurations carry a chat_template field, a jinja2 template that transformers-style pipelines render to format conversation turns; because templates are data fetched alongside a model, they are attacker-influenced when the model repository is not trusted. In languagemodels 1.0.0, Config.use_hf_model built the rendering environment as jinja2.Environment(loader=BaseLoader()), i.e. a full, unsandboxed environment. Jinja2's default environment exposes object internals through attribute traversal, so a template can walk from ordinary objects to imported modules and reach os, resulting in server-side template injection and command execution (CWE-1336, Improper Neutralization of Special Elements Used in a Template Engine). The confirming commit 48f4257a0d20a82075d2847a51036a3c8a2a0a13 replaces Environment with jinja2.sandbox.ImmutableSandboxedEnvironment and bumps setup.py to 1.0.1, which blocks the attribute traversal path rather than merely filtering individual payloads. The flaw is a template-rendering design weakness, not a memory-safety or network-protocol issue; the exposed surface is exactly the code path that loads tokenizer_config.json for a model chosen by the calling application. It is not remotely reachable against a default configuration: the attacker must control the model path or revision that the victim elects to load, and the victim must then invoke use_hf_model.
Know when Ssti gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Trigger is loading an attacker-controlled model into the process (AV:L, UI:R) with no prior privileges (PR:N); unsandboxed template yields full RCE as the victim process (C/I/A:H).
Primary rating from Vendor (vulncheck).
CVSS VectorVendor: vulncheck
Lifecycle Timeline
2DescriptionCVE.org
Languagemodels 1.0.0 contains a template injection vulnerability in Config.use_hf_model that allows remote attackers to execute code by supplying a malicious Hugging Face model chat_template. Attackers who control a model repository can craft a chat_template in tokenizer_config.json that reaches the os module through the unsandboxed jinja2 environment, running commands with the victim process privileges.
Executive ViewAI
CVE-2026-139989 is a high-severity template injection flaw in the Python languagemodels library 1.0.0 that allows an attacker controlling a Hugging Face model repository to execute arbitrary commands within the victim's Python process when the model is loaded. This impacts any team using languagemodels to load external models, potentially leading to full system compromise and data breach. Leadership should prioritize remediation due to the library's use in AI/ML workflows and the high CVSS score.
No vendor-released patch identified at time of analysis; restrict use of use_hf_model to trusted first-party models only, and isolate Python processes that load external models in sandboxed environments with minimal privileges.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Rejetto HTTP File Server, up to and including version 2.3m, is vulnerable to a template injection vulnerability. Rated c
Invision Community 5.0.0 through 5.0.6 contains an unauthenticated remote code execution vulnerability in the template e
changedetection.io is an open source web page change detection, website watcher, restock monitor and notification servic
Remote code execution in the WPML WordPress multilingual plugin (versions up to and including 4.6.12) allows Contributor
Server-side template injection in Adobe Commerce, Adobe Commerce B2B, and Magento Open Source allows remote unauthentica
Server-Side Template Injection in OpenCTI notifier templates allows privileged administrators with 'Manage customization
Unauthenticated remote code execution in Rejetto HFS2 (HTTP File Server) through version 2.4.0 lets an attacker execute
Tandoor Recipes is an application for managing recipes, planning meals, and building shopping lists. Rated critical seve
A server side template injection vulnerability in CrushFTP in all versions before 10.7.1 and 11.1.0 on all platforms all
Server-side template injection in OneBlog v2.3.9 and earlier lets an attacker who can supply FreeMarker template content
Remote code execution in WGDashboard 4.3.2 and earlier lets authenticated attackers inject Server-Side Template Injectio
Unauthenticated remote code execution affects BerriAI litellm through version 1.82.4, where the /prompts/test endpoint r
EUVD-2026-139658
GHSA-v286-88f6-fh24
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB