{"answers":{"affected":"3 open source packages ship an affected version, including homeassistant-cli. It affects 1 product.","exploited":"There is no known exploitation of CVE-2026-40602 in the wild and no public exploit code.","fix":"Upgrade homeassistant-cli to 1.0.0 or later.","what":"CVE-2026-40602 is a medium-severity vulnerability in home-assistant-ecosystem home-assistant-cli, published on 21 Apr 2026."},"fix_prompt":"Check this codebase for CVE-2026-40602 and fix it if it is affected.\n\nWhat it is: CVE-2026-40602 is a medium-severity vulnerability in home-assistant-ecosystem home-assistant-cli, published on 21 Apr 2026. \nExploitation: There is no known exploitation of CVE-2026-40602 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- homeassistant-cli (PyPI): affected all versions; fixed in 1.0.0\n- homeassistant-cli (PyPI): affected all versions; fixed in 1.0.0\n- homeassistant-cli (PyPI): affected all versions; fixed in 1.0.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2026-40602/ (Markdown: https://insights.sbomify.com/CVE-2026-40602/index.md)","id":"CVE-2026-40602","markdown":"https://insights.sbomify.com/CVE-2026-40602/index.md","name":"CVE-2026-40602","record":{"aliases":["GHSA-33qf-q99x-wpm8","PYSEC-2026-2518"],"analysis":null,"analysis_generated_by":null,"assigner":"GitHub_M","cpe":[{"product":"home_assistant_command-line_interface","vendor":"home-assistant-ecosystem"}],"cvss":{"score":5.6,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"},{"id":"CWE-1336","name":"Improper Neutralization of Special Elements Used in a Template Engine"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"hass-cli: Handling of user-supplied Jinja2 templates","id":"CVE-2026-40602","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":null,"year":"2026"},"n_packages":3,"n_references":2,"next":{"headline":"Chartbrew: Incorrect Access Control in /api/project/dashboard/:brewName via same-team override","id":"CVE-2026-40603"},"packages":[{"ecosystem":"PyPI","fixed":["1.0.0"],"introduced":["0"],"last_affected":[],"package":"homeassistant-cli","purl":null,"source":"GHSA-33qf-q99x-wpm8"},{"ecosystem":"PyPI","fixed":["1.0.0"],"introduced":["0"],"last_affected":[],"package":"homeassistant-cli","purl":"pkg:pypi/homeassistant-cli","source":"GHSA-33qf-q99x-wpm8"},{"ecosystem":"PyPI","fixed":["1.0.0"],"introduced":["0"],"last_affected":[],"package":"homeassistant-cli","purl":"pkg:pypi/homeassistant-cli","source":"PYSEC-2026-2518"}],"prev":{"headline":"Chartbrew: Missing Authorization in /api/chart/:chart_id/query via team-level refresh toggle","id":"CVE-2026-40601"},"products":["home-assistant-cli"],"published":"2026-04-21","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-04-21","vendors":["home-assistant-ecosystem"]},"summary":null,"url":"https://insights.sbomify.com/CVE-2026-40602/"}