chore: storage-value hardening (XSS review) + governance sync - #19
Merged
Merged
Conversation
…acters
Defense-in-depth from an XSS review: every render sink is already
inert (CSSOM property assignment, Lit-escaped bindings, ha-icon lookup
keys), but stored values weren't constrained — and DESIGN § 4.3
documented an icon shape check that didn't exist. Icons must now be
prefix:name; colors reject <>{};, quotes, backslash, control chars,
and url( while keeping the full real value space (hex, rgb()/hsl(),
named, var(--…), color-mix()).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A stale manifest otherwise ships inside the zip and the WS version command lies about what's installed. frontend/package.json is not gated: its semver prerelease format differs from PEP 440. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…TODO min_ha_version is not a manifest key HA reads — hacs.json's homeassistant field is the enforced floor. AGENTS pre-commit gate count 100 → 173. TODO's human-only-files block is done by this branch. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ha-icontreats icons as lookup keys), so this is defense-in-depth —iconmust beprefix:name(DESIGN §4.3 documented this check but it didn't exist), and colors reject characters no CSS color uses (<>{};, quotes, backslash, control chars,url(). 30 new parametrized tests cover hostile payloads (<script>,javascript:, CSS smuggling via;/escapes/url() and the full legitimate value space (hex,rgb()/hsl(), named,var(--…),color-mix(), custom icon packs).manifest.json(frontend package deliberately ungated — semver prerelease format differs from PEP 440).min_ha_versionmanifest key (hacs.json is the enforced floor), AGENTS.md gate count 100 → 173, TODO's human-only-files block resolved.Test plan
.venv/bin/pytest -q— 173 pass (was 143)cd frontend && npm run typecheck— zero errorscd frontend && npm test— passcd frontend && npm run build— no bundle drift (no frontend source changes)Manual / UI verification: n/a — validation + CI + docs; no paint-path change.
Risk
Docs touched
README.mdCHANGELOG.mdTODO.mdDESIGN.mddocs/examples.md🤖 Generated with Claude Code