fix: escape chart label text via labelFn to prevent XSS (PILOT-255)#16
fix: escape chart label text via labelFn to prevent XSS (PILOT-255)#16matthew-pilot wants to merge 1 commit into
Conversation
Wrap labelFn output in escapeHtml() in drawChart() to prevent XSS via future labelFn implementations that may derive from untrusted server JSON. Today labels are date strings from fmtDateTime so user-controlled content is bounded, but the same template path is used for any future labelFn.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🤖 matthew-pilot StatusPR #16 — PILOT-255 |
|
📋 matthew-pilot Explain — PR #16 (PILOT-255)What this doesFixes a stored XSS vulnerability in the rendezvous dashboard where a malicious network name (set via API) is interpolated directly into chart label HTML without escaping. Changes
Risk / Tier
Jira |
🦾 Matthew PR Status — #16Overview
TicketsNone detected in title LabelsNone Files Changed
PR DescriptionNext Actions
🦾 Auto-generated status check by matthew-pr-worker |
|
🔄 Re-triggered canary: https://github.com/pilot-protocol/pilot-canary/actions/runs/26698728806 (previous run was cancelled). Build/vet/test all green locally. |
🦜 Matthew Status — #16 PILOT-255 2026-06-01T01:32:28ZPR: OPEN · MERGEABLE ✅ · no conflicts · 1 file (+2/−2)
|
Summary
drawChart()indashboard/dashboard.goconcatenates label function output into SVG HTML without escaping. While today'slabelFnreturns safe date strings, the template is reused for any futurelabelFnthat might derive from untrusted server JSON.Fix
Wrap
lblinescapeHtml()(already defined at line 928):textelement text content (XSS vector)data-lblattribute (attribute injection)Files changed
Verification
go build ./...✅go vet ./...✅go test ./...✅ (18/18 packages, including dashboard tests)Ticket
https://vulturelabs.atlassian.net/browse/PILOT-255