fix cross-tenant dashboard read and service-map stored xss - #262
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Jun 26, 2026
Merged
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.
Fixes two privately-reported security issues (coordinated disclosure via KIberblick.de), both validated against current code.
1. Cross-tenant read on dashboard endpoints (high)
The dashboard endpoints took
organizationIdfrom the query string and only ran the org-membership check behindif (request.user?.id), which is set for session auth only. For API-key authrequireFullAccesslets any non-write key through without settingrequest.user, so the check was skipped and the org was read from the attacker-supplied query rather than the key's boundrequest.organizationId; withprojectIdomitted the project-in-org check was skipped too. A holder of any full-access API key (bound to org A) could read another organization's dashboard data.Fix: all handlers now route through a shared
resolveDashboardScope. For API-key auth it requires the requested org to match the key's bound org and the requested project to match (defaulting to the key's bound project when omitted), mirroringresolveQueryProjectIdwhich already protects the query and traces routes. Session auth keeps the org-membership and project-in-org checks.This also covers
GET /api/v1/dashboard/activity-overview, which had the same flaw and was not in the original report.Endpoints:
/stats,/timeseries,/top-services,/timeline-events,/recent-errors,/activity-overview.2. Stored XSS via OTLP
service.namein the service map (high)service.namefrom ingested traces passed throughsanitizeForPostgres(null bytes only), so< > " 'survived intospan.service_name.ServiceMap.svelte's EChartstooltip.formatterreturned raw HTML built fromparams.name/params.data.source/params.data.target, and ECharts renders tooltip output as HTML, so aservice.namelike<img src=x onerror=...>executed for any operator hovering the node/edge.Fix: user-derived tooltip values are HTML-escaped via a shared
escapeHtmlutil (also adopted by the SIEM HTML report builder, replacing its private copy). Stored data is left raw on purpose: escaping at the sink avoids double-encoding and keeps the JSON API correct.Tests
escapeHtmlunit test: 5/5 pass (incl.<img onerror>payload).svelte-check: 9 errors = pre-existing baseline, no new errors.No database migrations.