Files
wadamesh/web/console
Kaj SchittecatandClaude Opus 5.5 6698f55788 touch: web console refuses cross-origin requests and shows the requester's IP
Any page the user had open, or anyone on the LAN, could raise an approval
card with a HELLO or a GET to /api/files, and the card showed only the label
the browser sent.

The /mirror, /term and /files WebSocket upgrades are refused (403) when they
carry an Origin whose host:port is not the Host the request was sent to.
Browsers always send Origin on a WebSocket upgrade, so a missing one means a
non-browser client and stays allowed; the companion protocol path is not
checked at all, so the app and the web client connect as before.
/api/files also needs an X-Wada-Console header, which the console's Files
page now sends: a page on another site cannot add it without a CORS
preflight, and a plain cross-site GET (an image, a no-cors fetch) carries
neither header.

WebSessionAuth keeps the address of the request (hello/pending take an
optional ip), and the "Allow this browser?" card shows it on its own line
under the browser's label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 11:14:52 +01:00
..