CVE-2026-139989: Languagemodels 1.0.0 Jinja2 Template Injection RCE via Config.use_hf_model
Languagemodels 1.0.0 contains a template injection vulnerability in Config.usehfmodel that allows remote attackers to execute code by supplying a malicious Hugging Face model chattemplate. Attackers who control a model repository can craft a chattemplate in tokenizerconfig.json that reaches the os module through the unsandboxed jinja2 environment, running commands with the victim process privileges.
Affected Software
Event History
Frequently Asked Questions
What conditions are required for exploitation?
An attacker must control a Hugging Face model repository and place a malicious chat_template in its tokenizer_config.json. Exploitation requires a victim to use Config.use_hf_model to load that model; no attacker privileges are required, but victim interaction is required.
Which deployments are most exposed?
Deployments using Languagemodels 1.0.0 that load Hugging Face models from repositories not fully controlled or reviewed by the operator are exposed. The injected template executes commands with the privileges of the process loading the model.
How can I identify potentially affected use?
Identify uses of Config.use_hf_model in Languagemodels 1.0.0 and review the corresponding model repositories, especially tokenizer_config.json files containing chat_template values. Repositories controlled by untrusted parties should be treated as potential exploitation sources.