Skip to content

fix(web): escape dashboard HTML from driver names and plan reasons - #948

Open
frahlg wants to merge 1 commit into
masterfrom
agent/escape-dashboard-html
Open

fix(web): escape dashboard HTML from driver names and plan reasons#948
frahlg wants to merge 1 commit into
masterfrom
agent/escape-dashboard-html

Conversation

@frahlg

@frahlg frahlg commented Aug 18, 2026

Copy link
Copy Markdown
Member

Summary

A stored driver name or planner reason could run script in three dashboard views. The box only sets frame-ancestors in CSP, so that script would run as the operator.

  • Status bar: driver names now go through escHtml.
  • PV curtail picker: options are DOM nodes (textContent / value), not innerHTML.
  • Plan summary and tooltip: planner reasons go through escapeHTML.

Tests lock the three interpolations.

Why

Anyone who can set a driver name (setup, Settings, YAML) could persist markup. The dashboard reads /api/status without a login, so every browser that opens the page would run it.

Test plan

  • npm test (365 pass), including web/dashboard-xss.test.mjs
  • make verify on commit
  • Human: open Overview and Plan, confirm driver names and replan reason still render as text

A stored driver name or planner reason could run script in the status
bar, the PV curtail picker, and the plan tooltip. Those views had no
script CSP.
@frahlg frahlg mentioned this pull request Aug 18, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant