{"api_version":"1","generated_at":"2026-04-21T23:06:01+00:00","cve":"CVE-2026-40602","urls":{"html":"https://cve.report/CVE-2026-40602","api":"https://cve.report/api/cve/CVE-2026-40602.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-40602","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-40602"},"summary":{"title":"hass-cli: Handling of user-supplied Jinja2 templates","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.","state":"PUBLISHED","assigner":"GitHub_M","published_at":"2026-04-21 18:16:51","updated_at":"2026-04-21 18:16:51"},"problem_types":["CWE-94","CWE-1336","CWE-94 CWE-94: Improper Control of Generation of Code ('Code Injection')","CWE-1336 CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine"],"metrics":[{"version":"3.1","source":"security-advisories@github.com","type":"Secondary","score":"5.6","severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","data":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","baseScore":5.6,"baseSeverity":"MEDIUM","attackVector":"LOCAL","attackComplexity":"HIGH","privilegesRequired":"HIGH","userInteraction":"REQUIRED","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"NONE"}},{"version":"3.1","source":"CNA","type":"DECLARED","score":"5.6","severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","data":{"attackComplexity":"HIGH","attackVector":"LOCAL","availabilityImpact":"NONE","baseScore":5.6,"baseSeverity":"MEDIUM","confidentialityImpact":"HIGH","integrityImpact":"HIGH","privilegesRequired":"HIGH","scope":"UNCHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","version":"3.1"}}],"references":[{"url":"https://github.com/home-assistant-ecosystem/home-assistant-cli/pull/453","name":"https://github.com/home-assistant-ecosystem/home-assistant-cli/pull/453","refsource":"security-advisories@github.com","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/home-assistant-ecosystem/home-assistant-cli/security/advisories/GHSA-33qf-q99x-wpm8","name":"https://github.com/home-assistant-ecosystem/home-assistant-cli/security/advisories/GHSA-33qf-q99x-wpm8","refsource":"security-advisories@github.com","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-40602","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40602","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"home-assistant-ecosystem","product":"home-assistant-cli","version":"affected < 1.0.0","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"product":"home-assistant-cli","vendor":"home-assistant-ecosystem","versions":[{"status":"affected","version":"< 1.0.0"}]}],"descriptions":[{"lang":"en","value":"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."}],"metrics":[{"cvssV3_1":{"attackComplexity":"HIGH","attackVector":"LOCAL","availabilityImpact":"NONE","baseScore":5.6,"baseSeverity":"MEDIUM","confidentialityImpact":"HIGH","integrityImpact":"HIGH","privilegesRequired":"HIGH","scope":"UNCHANGED","userInteraction":"REQUIRED","vectorString":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","version":"3.1"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-94","description":"CWE-94: Improper Control of Generation of Code ('Code Injection')","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-1336","description":"CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-04-21T17:40:10.251Z","orgId":"a0819718-46f1-4df5-94e2-005712e83aaa","shortName":"GitHub_M"},"references":[{"name":"https://github.com/home-assistant-ecosystem/home-assistant-cli/security/advisories/GHSA-33qf-q99x-wpm8","tags":["x_refsource_CONFIRM"],"url":"https://github.com/home-assistant-ecosystem/home-assistant-cli/security/advisories/GHSA-33qf-q99x-wpm8"},{"name":"https://github.com/home-assistant-ecosystem/home-assistant-cli/pull/453","tags":["x_refsource_MISC"],"url":"https://github.com/home-assistant-ecosystem/home-assistant-cli/pull/453"}],"source":{"advisory":"GHSA-33qf-q99x-wpm8","discovery":"UNKNOWN"},"title":"hass-cli: Handling of user-supplied Jinja2 templates"}},"cveMetadata":{"assignerOrgId":"a0819718-46f1-4df5-94e2-005712e83aaa","assignerShortName":"GitHub_M","cveId":"CVE-2026-40602","datePublished":"2026-04-21T17:40:10.251Z","dateReserved":"2026-04-14T14:07:59.641Z","dateUpdated":"2026-04-21T17:40:10.251Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-04-21 18:16:51","lastModifiedDate":"2026-04-21 18:16:51","problem_types":["CWE-94","CWE-1336","CWE-94 CWE-94: Improper Control of Generation of Code ('Code Injection')","CWE-1336 CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine"],"metrics":{"cvssMetricV31":[{"source":"security-advisories@github.com","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N","baseScore":5.6,"baseSeverity":"MEDIUM","attackVector":"LOCAL","attackComplexity":"HIGH","privilegesRequired":"HIGH","userInteraction":"REQUIRED","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"NONE"},"exploitabilityScore":0.3,"impactScore":5.2}]},"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"40602","Ordinal":"1","Title":"hass-cli: Handling of user-supplied Jinja2 templates","CVE":"CVE-2026-40602","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"40602","Ordinal":"1","NoteData":"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.","Type":"Description","Title":"hass-cli: Handling of user-supplied Jinja2 templates"}]}}}