Template injection in languagemodels lets remote attackers run code
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Passive
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-1336.
Summary
The jncraton languagemodels package from 1.0.0 before 1.0.1 has a template injection flaw in Config.use_hf_model, where a Jinja2 template is not sandboxed. A remote attacker who controls a Hugging Face model repository can supply a malicious chat_template in tokenizer_config.json, which reaches the os module and runs commands with the privileges of the victim process. The CVSS 4.0 vector rates the attack as requiring user interaction, with no privileges needed.
Written with Claude Haiku 5.5 from the sources below · 2026-11-30
Description from the CNA
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
Remediation
Update languagemodels to version 1.0.1, which is the fixed version. The sources list no advisory identifiers for this fix.
Written with Claude Haiku 5.5 from the sources below · 2026-11-30
- Fix · CNA languagemodels (jncraton) Fixed in 1.0.1
Timeline
- 2026-11-30 Threatist record created from CVE-2026-139989
- 2026-11-30 Alias added: GHSA-v286-88f6-fh24
References
Patch 2
Sources
- CVE-2026-139989 · CVE Program
- CVE-2026-139989 · NVD
- GHSA-v286-88f6-fh24 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences