Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-40602: CWE-94: Improper Control of Generation of Code ('Code Injection') in home-assistant-ecosystem home-assistant-cli

0
Medium
VulnerabilityCVE-2026-40602cvecve-2026-40602cwe-94cwe-1336
Published: Tue Apr 21 2026 (04/21/2026, 17:40:10 UTC)
Source: CVE Database V5
Vendor/Project: home-assistant-ecosystem
Product: home-assistant-cli

Description

CVE-2026-40602 is a code injection vulnerability in the Home Assistant Command-line interface (hass-cli) prior to version 1. 0. 0. The issue arises because user-supplied input within Jinja2 templates was rendered without sandboxing, allowing access to Python internals and unintended code execution. This vulnerability has a medium severity rating and a CVSS score of 5. 6. The vulnerability is fixed in version 1. 0. 0 of home-assistant-cli.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/21/2026, 18:16:30 UTC

Technical Analysis

The Home Assistant CLI (hass-cli) versions before 1.0.0 used an unrestricted environment to render Jinja2 templates, which allowed user-supplied input to execute arbitrary Python code locally. This improper control of code generation (CWE-94) extends the templating scope beyond intended usage, potentially enabling code injection attacks. The vulnerability is addressed by introducing sandboxing in version 1.0.0, preventing untrusted template code from accessing Python internals.

Potential Impact

Successful exploitation could allow a user with access to the CLI to execute arbitrary Python code locally, potentially leading to unauthorized information disclosure or modification of the system state. The CVSS vector indicates that exploitation requires local access with high privileges and user interaction, and the impact is high on confidentiality and integrity but does not affect availability.

Mitigation Recommendations

Upgrade home-assistant-cli to version 1.0.0 or later, where this vulnerability is fixed by sandboxing Jinja2 template rendering. No other mitigations are indicated or necessary once the update is applied.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-04-14T14:07:59.641Z
Cvss Version
3.1
State
PUBLISHED
Remediation Level
null

Threat ID: 69e7bb7219fe3cd2cdedac86

Added to database: 4/21/2026, 6:01:22 PM

Last enriched: 4/21/2026, 6:16:30 PM

Last updated: 4/21/2026, 7:19:24 PM

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses