fix(security): remove x-spark-preview-root header leaking server path - #873
Open
Esc1200 wants to merge 1 commit into
Open
fix(security): remove x-spark-preview-root header leaking server path#873Esc1200 wants to merge 1 commit into
Esc1200 wants to merge 1 commit into
Conversation
…ilesystem path The x-spark-preview-root response header exposed the absolute server filesystem path (asset.projectRoot) to preview route clients. This is an information disclosure vulnerability (LOW-MEDIUM) that reveals internal directory structure to potential attackers. Removed the header from both preview/[token] and preview/[token]/[...asset] route handlers.
ifeoluwaaj
pushed a commit
to ifeoluwaaj/vibeship-spawner-ui
that referenced
this pull request
Jun 27, 2026
Consolidates a same-author path-redaction series: - Remove tracePath from creator mission GET response (vibeforge1111#877) - Remove server path from mission active POST response (vibeforge1111#876) - Remove rawResponse field from analyze error response (vibeforge1111#874) - Remove x-spark-preview-root header leaking server path (vibeforge1111#873) - Use trusted x-real-ip / last x-forwarded-for entry for the rate-limiter client key (vibeforge1111#875) Surviving-line indentation normalized back to file style (the patches bundled an over-indentation reflow of untouched lines). Co-authored-by: Esc1200 <Esc1200@users.noreply.github.com> Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Bug: Preview routes leak absolute server filesystem path via
x-spark-preview-rootHTTP response headerSeverity: LOW-MEDIUM
File(s):
src/routes/preview/[token]/+server.ts(line 24)src/routes/preview/[token]/[...asset]/+server.ts(line 28)Problem:
Both preview route handlers include
asset.projectRootas thex-spark-preview-rootresponse header. This exposes the absolute server filesystem path (e.g./home/user/projects/myapp) to any client making a preview request. An attacker can use this to learn internal directory structure, server username, and deployment layout.Fix:
Removed the
x-spark-preview-rootheader from both preview response handlers. The header provided no functional benefit to clients — it was purely diagnostic information that should not leave the server.Testing: