Vulnerability · Published Apr 21, 2026 · Assigned by GitHub_M
CVE-2026-40602hass-cli: Handling of user-supplied Jinja2 templates
Medium 5.6
In plain English
A medium-severity code injection in home-assistant-cli from home-assistant-ecosystem. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.1% (higher than 1% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | homeassistant-cli | 1.0.0 | GHSA-33qf-q99x-wpm8 |
| PyPI | homeassistant-cli | 1.0.0 | PYSEC-2026-2518 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| home-assistant-ecosystem | home-assistant-cli | < 1.0.0 |
Weakness: CWE-94, CWE-1336 · Vector: CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N