Skip to main content

languagemodels CVE-2026-139989

| EUVDEUVD-2026-139658 HIGH
Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336)
2026-11-30 disclosure@vulncheck.com GHSA-v286-88f6-fh24
8.5
CVSS 4.0 · Vendor: vulncheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Publish malicious Hugging Face model repo
  2. Delivery
    Victim calls use_hf_model on that repo
  3. Exploit
    Unsandboxed jinja2 renders crafted chat_template
  4. Execution
    Template payload reaches os module
  5. Impact
    Execute 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

languagemodels 1.0.0 <1.0.1

Affected Packages

euvd languagemodels fix: 1.0.1

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

Vendor (vulncheck) PRIMARY 8.5 HIGH
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
vuln.today AI 7.8 HIGH

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).

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (vulncheck).

CVSS VectorVendor: vulncheck

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Nov 30, 2026 - 20:05 EUVD
CVE Published
Nov 30, 2026 - 19:17 cve.org
HIGH 8.5

DescriptionCVE.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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.5%
Top 57% exploitable
Prevalence
Low
niche educational/hobby Python library, limited production deployment footprint
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

More in Ssti

View all
CVE-2024-23692 CRITICAL POC
9.8 May 31

Rejetto HTTP File Server, up to and including version 2.3m, is vulnerable to a template injection vulnerability. Rated c

CVE-2025-47916 CRITICAL POC
10.0 May 16

Invision Community 5.0.0 through 5.0.6 contains an unauthenticated remote code execution vulnerability in the template e

CVE-2024-32651 CRITICAL POC
10.0 Apr 26

changedetection.io is an open source web page change detection, website watcher, restock monitor and notification servic

CVE-2024-6386 CRITICAL POC
9.9 Aug 21

Remote code execution in the WPML WordPress multilingual plugin (versions up to and including 4.6.12) allows Contributor

CVE-2026-75650 CRITICAL POC
10.0 Sep 07

Server-side template injection in Adobe Commerce, Adobe Commerce B2B, and Magento Open Source allows remote unauthentica

CVE-2026-39980 CRITICAL POC
9.1 Apr 09

Server-Side Template Injection in OpenCTI notifier templates allows privileged administrators with 'Manage customization

CVE-2026-97359 CRITICAL POC
10.0 Sep 24

Unauthenticated remote code execution in Rejetto HFS2 (HTTP File Server) through version 2.4.0 lets an attacker execute

CVE-2025-23211 CRITICAL POC
9.9 Jan 28

Tandoor Recipes is an application for managing recipes, planning meals, and building shopping lists. Rated critical seve

CVE-2024-4040 CRITICAL POC
10.0 Apr 22

A server side template injection vulnerability in CrushFTP in all versions before 10.7.1 and 11.1.0 on all platforms all

CVE-2025-60355 CRITICAL POC
9.8 Oct 28

Server-side template injection in OneBlog v2.3.9 and earlier lets an attacker who can supply FreeMarker template content

CVE-2026-15734 CRITICAL POC
9.8 Aug 06

Remote code execution in WGDashboard 4.3.2 and earlier lets authenticated attackers inject Server-Side Template Injectio

CVE-2026-37004 CRITICAL POC
9.8 Aug 27

Unauthenticated remote code execution affects BerriAI litellm through version 1.82.4, where the /prompts/test endpoint r

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy