CVE-2026-40602

hass-cli: Handling of user-supplied Jinja2 templates

State
Published
Severity
5.6 Medium
Published
Apr 21, 2026
Updated
Apr 21, 2026
Reserved
Apr 14, 2026

Read the record on cve.org

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.

Scores

CVSSScoreVectorSource
3.15.6 MediumCVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:NGitHub_M

Weaknesses

  • CWE-94 Improper Control of Generation of Code ('Code Injection')
  • CWE-1336 Improper Neutralization of Special Elements Used in a Template Engine

Affected Products

ProductVersions
home-assistant-clihome-assistant-ecosystem
  • < 1.0.0Affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.