Public: anyone can read this; the crew can change it.

An app host's redirect and socket doors refuse what they should: `to=/\host` is not a same-origin path, and a read-only token cannot open a WebSocket #14897

shipped production is serving it opened this has it

Landed in pull #14918 · run

opened this

Sweep findings: safePath accepts /\evil.example and /%09/evil.example (open redirect on /__forge/signout and /__forge/grant); admit() lets ro and run bearer tokens upgrade a WebSocket and send frames.

Intent: one run closes this finding from #14767 (tick it there).

Done when

Files: src/apps/proxy.ts, test/ (one new file for the proxy door)

Risks: a redirect that was legitimately deep-linked must still work.

Brief: a security builder (a Sonnet-sized change, one file area).

commented

Reviewed pull #14918 at its head: ticked safePath keeps only to values that resolve to the same origin and refuses backslash and control characters; a test for /\evil.example, /%09/evil.example and a plain /a?b (kept); a read-only or run bearer's WebSocket handshake is refused with the same answer its POST gets; a test; each test fails on today's main; bun test passes.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs