Repository navigation
fix(security): studio loopback + token; vargai needs @vargai/mcp ^0.20.0 (alpha125) - #252
Conversation
…^0.20.0
studio's POST /api/render runs the code it is sent, and the server listened
on every interface with no check: remote code execution for anyone on the
network, and for any web page through a cross-site POST to localhost:8282.
Now it binds 127.0.0.1, wants a per-launch token (the printed URL carries it
once, then an HttpOnly SameSite=Strict cookie, or a bearer), and refuses any
Host but 127.0.0.1/localhost so a DNS-rebinding page cannot reach it.
`vargai mcp` / every MCP command now resolves @vargai/mcp@^0.20.0, the first
release whose upload_file{path} stays in the project and asks, and whose
--http is loopback + token (vargHQ/mcp#59).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
What was open
vargai@0.4.0-alpha124(npmlatest) shipsvargai studio:POST /api/renderimports and runs the TSX it is sent, on a server bound to every interface with no auth. Anyone on the same network — or any web page, via a cross-sitetext/plainPOST tolocalhost:8282— could run code on the machine.#251 already removed the
studiocommand from the CLI for alpha125, butvargai/studio(andbun run studio) still start the same server.Fix
127.0.0.1VARG_STUDIO_TOKENor random 256-bit): the printed URL carries it once (/?token=…→ 302 +HttpOnly; SameSite=Strictcookie), orAuthorization: Bearer127.0.0.1:<port>/localhost:<port>→ DNS rebinding gets 403vargai mcp …resolves@vargai/mcp@^0.20.0— the release with the upload_file /--httpfixes (vargHQ/mcp#59)Tests
src/studio/server.test.ts(intest:ci): no token 401, foreign Host 403, token link → cookie, LAN address refused.test:ci: 445 pass, 0 fail;tsc --noEmitclean.Release plan: publish 0.4.0-alpha125 as
latest/alpha, deprecate ≤ alpha124.🤖 Generated with Claude Code