Skip to content

← Actionable
Medium, CVSS 5.6amended

Home Assistant Command-line Interface: Handling of user-supplied Jinja2 templates

CVE-2026-40602GHSA-33qf-q99x-wpm8

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (homeassistant-cli 1.0.0), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
5.6 · CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N
EPSS
  • CVE-2026-40602: 0.10% estimated exploitation activity in the next 30 days; percentile 0.99 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description

As published by the source; long descriptions are shortened.

Impact Up to 1.0.0 of home-assitant-cli (or hass-cli for short) 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. E. g., it was possible to render a template with hass-cli template bad-template.j2 --local that contained entries like or other malicious Jinja2 expressions. This can lead to arbitrary code execution on the local machine. In a two step process an adversary could trick/convince an user to download third-party templates which contain harmful code (e. g., perform data manipulation or establish a remote shell) then to render those templates unchecked/reviewed/verified with --local. The issue only affect the local machine and not a remote Home Assistant instance. It also requires user interventions. Patches 1.0.0 uses…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 2 · amended ·

    Amended from ghsa record GHSA-33qf-q99x-wpm8

  2. Revision 1 · created ·

    Published from osv record GHSA-33qf-q99x-wpm8

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: CVE-2026-40602

Advisory: Home Assistant Command-line Interface: Handling of user-supplied Jinja2 templates
IDs: CVE-2026-40602, GHSA-33qf-q99x-wpm8
Record: https://patchnext.com/advisories/cve-2026-40602 (revision 2, source checked 26 Oct 2026, 13:40 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 5.6)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: homeassistant-cli 1.0.0. A vendor fix does not mean a deployment is fixed.

## Affected components
- PyPI homeassistant-cli: affected < 1.0.0; fixed in 1.0.0

## Suggested inspection (read-only)
- `python -m pip show homeassistant-cli`: prints the installed version. Run with the environment that serves production active.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on homeassistant-cli.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/GHSA-33qf-q99x-wpm8 (OSV record GHSA-33qf-q99x-wpm8 lists affected ranges: PyPI homeassistant-cli >=0 <1.0.0 (fixed))
- Verified: https://github.com/advisories/GHSA-33qf-q99x-wpm8 (GitHub-reviewed advisory GHSA-33qf-q99x-wpm8 lists affected ranges: PyPI homeassistant-cli >=0 <1.0.0)

Commands are suggestions: review each one before running it.

Loading voting…