Skip to content

fix(security): remove x-spark-preview-root header leaking server path - #873

Open
Esc1200 wants to merge 1 commit into
vibeforge1111:mainfrom
Esc1200:spark/fix-preview-route-path-leak
Open

fix(security): remove x-spark-preview-root header leaking server path#873
Esc1200 wants to merge 1 commit into
vibeforge1111:mainfrom
Esc1200:spark/fix-preview-route-path-leak

Conversation

@Esc1200

@Esc1200 Esc1200 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Bug: Preview routes leak absolute server filesystem path via x-spark-preview-root HTTP response header

Severity: 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.projectRoot as the x-spark-preview-root response 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-root header 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:

  • Preview routes still serve content correctly (the header was not used client-side)
  • No other code references this header

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant