MJ::WebGuard
mj serve is for this machine only, and has no login (the security review,
2026-10-21). Two checks keep other sites out of it:
- The Host must name this machine. A page can point its own domain at 127.0.0.1 (DNS rebinding) and then read the studio as if it were its own; its requests still carry its domain as the Host.
- A browser's cross-site request is refused unless it only reads. A page you
visit could otherwise post a form to
/soundbox/ttsor a render and spend money. Browsers say where a request came from inSec-Fetch-SiteandOrigin; a request without them (curl, a script) isn't from a browser page, and passes.
Constants
LOCAL_NAMES = {"localhost", "127.0.0.1", "[::1]"}
SAFE = {"GET", "HEAD", "OPTIONS"}