Repository navigation
fix: harden dashboardApiFetch against SSRF (CodeQL #12) - #574
Merged
Merged
Conversation
Restrict API fetches to relative /api paths on API_BASE_URL and validate error group ids before path interpolation. Co-authored-by: Cursor <[email protected]>
5 tasks
FelineFantasy
pushed a commit
to FelineFantasy/telemetry-tracker
that referenced
this pull request
Jul 20, 2026
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
js/request-forgery) by hardeningdashboardApiFetch/dashboardApiFetchFromCookiesURL construction and validatingerrorGroupIdinsetErrorResolvedAction./api/...paths are accepted; resolved URLs must stay on the fixedAPI_BASE_URLorigin with pathname under/api/.Call-site audit
lib/dashboard-api.tspath.startsWith("http")(unused)pathAndQuery)resolveDashboardApiUrlis the single gateapp/dashboard/actions.tssetErrorResolvedAction(errorGroupId)(alert source); other actions mostly UUID-validated org/project/key idsencodeURIComponenton error group iderrors/events/sessions/[id])params.idinterpolated into/api/...URLSearchParamsonly/api/...literals + queryencodeURIComponent/api/...onlyapp/api/telemetry/[...path]/route.tssessions/events/errors[+analytics])dashboardApiFetchdashboardApiClientFetchFindings: No production call site passed absolute URLs. Redirects are not configured on these fetches (default
follow); SSRF risk was path/host injection via unsanitized interpolation, not open redirects. Prefer fix over dismissing the alert.Test plan
pnpm test lib/dashboard-api-url.test.ts(dashboard)pnpm lint(dashboard)develop— no findingsbuild/ Bugbot checks greendevelopafter mergeMade with Cursor