fix: escape chart label text via labelFn to prevent XSS (PILOT-255)#16
Open
matthew-pilot wants to merge 1 commit into
Open
fix: escape chart label text via labelFn to prevent XSS (PILOT-255)#16matthew-pilot wants to merge 1 commit into
matthew-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! |
Collaborator
Author
🤖 matthew-pilot StatusPR #16 — PILOT-255 |
|
Collaborator
Author
📋 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 |
Collaborator
Author
🦾 Matthew PR Status — #16Overview
TicketsNone detected in title LabelsNone Files Changed
PR DescriptionNext Actions
🦾 Auto-generated status check by matthew-pr-worker |
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
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