Skip to content

fix: escape HTML in admin pages and sandbox static file responses - #181

Open
huangji6693-max wants to merge 1 commit into
tscircuit:mainfrom
huangji6693-max:fix/issue-175
Open

huangji6693-max wants to merge 1 commit into
tscircuit:mainfrom
huangji6693-max:fix/issue-175

Conversation

@huangji6693-max

@huangji6693-max huangji6693-max commented Oct 27, 2026 •

Copy link
Copy Markdown

Closes #175
/claim #175

Summary

  • Add escapeHtml helper in lib/utils/escape-html.ts and escape dynamic values (file_path, file_id, created_at, event_type, serialized event details, and text_content) across /admin/files/list, /admin/files/get, and /admin/events/list to prevent stored XSS.
  • Add Content-Security-Policy: sandbox and X-Content-Type-Options: nosniff response headers on /files/static/[[...file_path]] so uploaded active content cannot execute scripts in the server origin.
  • Add regression tests in tests/routes/admin-files-page.test.ts.

Verification

  • bun test (30 pass, 0 fail)
  • bun run format:check (0 errors)

Payout Wallets

  • EVM / Base (USDC): 0x380C97bcbcAEf29DAc2d0ba7E180F1b4A7F38fdd
  • Stellar (XLM / USDC): GBYWLISGOUWQ43VQEGXX6KRGDZ3CKAFFK3JXVLXKDO5TIFJUJ3OHJYOZ
  • Solana (USDC / SOL): AyXYaA9Nf4z5fpLKY6DmubWe6D2qveMd79w8pEDNHcDw

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.

Stored XSS in admin dashboards + active content served on the admin origin via unauthenticated /files/upsert

1 participant