Skip to content
Fencer Intel
medium 5.6

CVE-2026-40602 json

hass-cli: Handling of user-supplied Jinja2 templates

published 6mo ago modified 14d ago also GHSA-33qf-q99x-wpm8 , PYSEC-2026-2518 , EUVD-2026-24211

cvss
5.6
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.1%
EPSS 0.1% chance of exploitation in 30 days, percentile 0%
public exploits
0
none known

Summary

The Home Assistant Command-line interface (hass-cli) is a command-line tool for Home Assistant. Up to 1.0.0 of home-assitant-cli an unrestricted environment was used to handle Jninja2 templates instead of a sandboxed one. The user-supplied input within Jinja2 templates was rendered locally with no restrictions. This gave users access to Python's internals and extended the scope of templating beyond the intended usage. This vulnerability is fixed in 1.0.0.

Patch / fix

  • pypi homeassistant-cli 1.0.0
  • home-assistant-ecosystem home_assistant_command-line_interface 1.0.0

Is CVE-2026-40602 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2026-40602 updated cvss 8.2

home-assistant-cli: Jinja2: Home Assistant Command-line interface: Arbitrary code execution via unrestricted Jinja2 template rendering

  • Red Hat All currently supported Red Hat products
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
total
Assessed
6mo ago

Exploit prediction

0.10% chance of exploitation in the next 30 days, higher than 0% of all scored CVEs (FIRST EPSS, 2026-11-09).

CVSS scores

assigned by version score vector
CNA 3.1 5.6 CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N
OSV 3.1 5.6 CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N
GitHub 3.1 5.6 CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N

Affected packages

ecosystem package affected fixed in
pypi homeassistant-cli
<1.0.0
1.0.0

Affected products

  • home-assistant-ecosystem home-assistant-cli

Classification

Weakness
  • CWE-94 Improper Control of Generation of Code
  • CWE-1336 Improper Neutralization of Special Elements Used in a Template Engine

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.