hyperhive/frontend/packages/dashboard/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
iris ccc5e631e2 web-ui: sanitize markdown HTML with DOMPurify to fix XSS
Both mdNode implementations (agent UI app.js, dashboard common.js)
assigned marked.parse() output straight to innerHTML with no
sanitizer. marked v5+ dropped its built-in sanitize option, and there
was no DOMPurify anywhere in frontend/, so markdown containing raw
HTML/script tags rendered live in the browser.

Both sinks receive untrusted input in practice: the agent UI's mdNode
renders recv tool_result bodies, assistant prose, and send/ask/answer
payloads sourced from peer agents and matrix-relayed messages (the
documented prompt-injection adversary); the dashboard's mdNode renders
agent-authored .md files served verbatim by GET /api/state-file
(the endpoint validates path, not content). Since the per-agent UI and
dashboard are same-origin behind the gateway with operator-authority
endpoints (approve/spawn/rebuild/destroy/answer-question), injected
script would run with the operator's session.

Fix: DOMPurify.sanitize() the marked.parse() output at both sinks
before assigning to innerHTML. Added dompurify as a dependency to
both the agent and dashboard npm workspaces, recomputed npmDepsHash
in nix/frontend.nix for the updated lockfile. Also corrected
docs/web-ui/shape.md, which claimed the markdown-rendering path was
XSS-safe by construction the same way the text-node-based linkify
path is — it isn't; it's safe because it's sanitized.

CSP hardening for the dashboard (no unsafe-inline) is a separate,
larger backend change (response headers in hive-c0re) and is left as
a fast-follow rather than folded into this fix.
2026-07-10 11:54:50 +02:00
..
builds.css feat(builds): add /builds.html — build lifecycle hub (closes #1999) 2026-06-28 23:56:11 +02:00
builds.html fix(dashboard): replace stale 'manager' with 'submitter' in approval UI text 2026-07-02 14:15:07 +02:00
builds.js feat(dashboard): node-aware queue render + buildSlots option 2026-07-06 20:36:57 +02:00
call.js dashboard frontend: consume rfc3339 timestamps from the api 2026-07-02 22:28:30 +02:00
colors.css refactor(frontend): base16 theme contract in a swappable colors.css 2026-06-08 21:24:07 +02:00
common.css feat(dash): show active model badge on agent cards (closes #2069) 2026-06-27 22:59:40 +02:00
common.js web-ui: sanitize markdown HTML with DOMPurify to fix XSS 2026-07-10 11:54:50 +02:00
core.css refactor(fe): trim impl-history and duplicated-docs prose from comments 2026-06-29 00:12:30 +02:00
core.html feat(builds): add /builds.html — build lifecycle hub (closes #1999) 2026-06-28 23:56:11 +02:00
core.js feat(builds): add /builds.html — build lifecycle hub (closes #1999) 2026-06-28 23:56:11 +02:00
dashboard.css fix(dashboard): contain rebuild spinner within icon boundary 2026-06-29 01:05:34 +02:00
dashboard.html dashboard(html): fix stale P3RM1SS10NS pane comment after the save-all change 2026-06-17 20:14:09 +02:00
flow.css chore(frontend): scrub pre-existing issue-tag refs from source comments 2026-06-09 00:24:49 +02:00
flow.html refactor(frontend): extract the page-chrome into @hive/shared (#1464 step 3) 2026-06-09 09:13:35 +02:00
flow.js dashboard frontend: consume rfc3339 timestamps from the api 2026-07-02 22:28:30 +02:00
home.css dashboard(home): matrix-rain backdrop on the H0M3 page 2026-06-17 21:46:25 +02:00
home.js dashboard(home): harden matrix-rain fade-trail colour parsing 2026-06-17 21:59:12 +02:00
index.html feat(builds): add /builds.html — build lifecycle hub (closes #1999) 2026-06-28 23:56:11 +02:00
logs.css feat(dashboard): AUD1T — privileged-actions audit trail as a LOGS sub-tab 2026-06-13 15:31:50 +02:00
logs.html feat(builds): add /builds.html — build lifecycle hub (closes #1999) 2026-06-28 23:56:11 +02:00
logs.js dashboard frontend: consume rfc3339 timestamps from the api 2026-07-02 22:28:30 +02:00
matrix-accounts.css dashboard(matrix-accounts): dim live dot when daemon heartbeat stalls 2026-06-22 14:15:19 +02:00
matrix-accounts.html dashboard: drop matrix-accounts experimental notice; relabel list as provisioned 2026-06-16 10:22:53 +02:00
matrix-accounts.js refactor(fe): trim >30-line comment blocks (second pass, #2077) 2026-06-29 01:05:53 +02:00
modal.css fix(dashboard): extract themed-dialog styles into an importable modal.css 2026-06-22 22:24:42 +02:00
modal.js dashboard: themedPrompt is a textarea — Enter submits, Shift+Enter newline 2026-06-21 23:55:15 +02:00
permissions.js refactor(fe): trim >30-line comment blocks (second pass, #2077) 2026-06-29 01:05:53 +02:00
schedules.js dashboard frontend: consume rfc3339 timestamps from the api 2026-07-02 22:28:30 +02:00
settings.css refactor(frontend): extract the page-chrome into @hive/shared (#1464 step 3) 2026-06-09 09:13:35 +02:00
settings.html refactor(frontend): extract the page-chrome into @hive/shared (#1464 step 3) 2026-06-09 09:13:35 +02:00
settings.js refactor(frontend): move S3TT1NGS to its own /settings.html page (#1464 step 2) 2026-06-08 23:44:22 +02:00
state.js dashboard: extract operator-inbox + approvals into call.js (#1451) 2026-06-16 10:22:53 +02:00
stats.css refactor(frontend): extract the page-chrome into @hive/shared (#1464 step 3) 2026-06-09 09:13:35 +02:00
stats.html feat(stats): add an 'all' time range to agent + hive stats 2026-06-22 23:47:20 +02:00
stats.js refactor(frontend): move ST4TS to its own /stats.html page (#1464 step 2) 2026-06-09 00:11:43 +02:00
stream-worker.js refactor(fe): trim >30-line comment blocks (second pass, #2077) 2026-06-29 01:05:53 +02:00
swarm.js fix(hive-c0re): close review findings on the job-DAG queue 2026-07-06 21:44:43 +02:00
system-sections.css feat(dashboard): node-aware queue render + buildSlots option 2026-07-06 20:36:57 +02:00
tabs.js refactor(dashboard): extract SW4RM domain from tabs.js into swarm.js 2026-07-04 11:37:39 +02:00
theme.css refactor(frontend): base16 theme contract in a swappable colors.css 2026-06-08 21:24:07 +02:00
util.js dashboard frontend: consume rfc3339 timestamps from the api 2026-07-02 22:28:30 +02:00