---
id: CVE-2026-139989
title: >-
  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
summary: >-
  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 …
severity: high
cvss: 7.8
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'
cwe:
  - CWE-1336
vendor: jncraton
product: languagemodels
affected:
  - languagemodels >= 1.0.0 < 1.0.1
published: '2026-11-30'
updated: '2026-12-01'
sourceUpdated: '2026-12-01T14:18:18.023'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-139989'
references:
  - url: >-
      https://github.com/jncraton/languagemodels/blob/a875090e2b74257e44bd0a534f42704a1014d61c/languagemodels/config.py#L366-L380
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/jncraton/languagemodels/commit/48f4257a0d20a82075d2847a51036a3c8a2a0a13
    label: disclosure@vulncheck.com
  - url: 'https://github.com/jncraton/languagemodels/issues/43'
    label: disclosure@vulncheck.com
  - url: 'https://github.com/jncraton/languagemodels/pull/44'
    label: disclosure@vulncheck.com
  - url: 'https://pypi.org/project/languagemodels/1.0.1/'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/languagemodels-1.0.0-jinja2-template-injection-rce-via-config-use-hf-model
    label: disclosure@vulncheck.com
  - url: 'https://github.com/jncraton/languagemodels/issues/43'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
tags:
  - nvd
  - cve.org
  - exploit-available
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: total
  timestamp: '2026-12-01T13:20:25.336486Z'
ingestedAt: '2026-11-30T19:45:10.856Z'
epss: 0.00849
epssPercentile: 0.59267
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
