Vulnérabilité dans homeassistant-cli (CVE-2026-40602)
Résumé
Vulnérabilité dans homeassistant-cli (CVE-2026-40602). Des informations confidentielles peuvent être exposées. Exploitable via ImmutableSandboxedEnvironment. Atténuation : mise à jour vers 1.0.0 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
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
{%- set b = environ.__globals__['__builtins__'] -%}
{%- set os = b['__import__']('os') -%}
{%- set bio = b['__import__']('builtins') -%}
...
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 ImmutableSandboxedEnvironment and restricts the usage of environment variables.
Workarounds
Evaluate the Jninja2 templates manually or tool-based before rendering with hass-cli.
Source: OSV.dev (Open Source Vulnerabilities) NVD GitHub Advisory OSV
Résumé généré automatiquement
Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.
Une vulnérabilité référencée CVE-2026-40602 a été découverte dans homeassistant-cli.
Des attaquants peuvent cibler un point d'entrée spécifique comme ImmutableSandboxedEnvironment à distance pour détourner le produit.
Des informations confidentielles peuvent être exposées.
Action : mettez à jour homeassistant-cli vers 1.0.0 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « homeassistant-cli CVE-2026-40602 » sur le site de l'éditeur.
CVE-2026-40602 (homeassistant-cli) — CWE-1336
Vecteur d'attaque : local
Surface d'attaque : ImmutableSandboxedEnvironment
Correctif : 1.0.0 — appliquer immédiatement
Contournement : Evaluate the Jninja2 templates manually or tool-based before rendering with hass-cli.
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
Une vulnérabilité (CWE-1336) affecte homeassistant-cli. Les attaquants atteignent le code vulnérable via ImmutableSandboxedEnvironment.
Consultez l'avis de l'éditeur pour les versions affectées de homeassistant-cli. Surface d'attaque : ImmutableSandboxedEnvironment.
Gravité : ?. Des informations confidentielles peuvent être exposées.
Mettre à jour vers 1.0.0.
Contournement : Evaluate the Jninja2 templates manually or tool-based before rendering with hass-cli.
Recherchez dans les logs des requêtes correspondant aux IOC connus de cette CVE. Auditez les SBOM/dépendances.
Actions de réponse
Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre
-
1Identify exposure identify
grep -r 'homeassistant-cli' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
homeassistant-cliを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
Evaluate the Jninja2 templates manually or tool-based before rendering with `hass-cli`.パッチが適用されるまでの応急処置として、Evaluate the Jninja2 templates manually or tool-based before rendering with
hass-cli. を実施。回避策の副作用 (機能低下) を確認した上で。 -
3Apply patch patch
Upgrade homeassistant-cli to 1.0.0ステージング環境で 1.0.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
Références
- advisory nvd.nist.gov
- package github.com
- web github.com
- web github.com