Skip to content

Add random-token authentication to the web IDE

Mike Boyer requested to merge experimental-url-token into main

pyide_web.py had no authentication at all -- under the default 127.0.0.1 bind, the realistic exposure isn't a network attacker but any other webpage open in the same browser reaching /api/run, file read/write, and the debug session (old browsers like Pale Moon predate the newer same-origin protections that partially block this). Same class of bug Jupyter notebooks had before they added a token.

Cookie-based (SameSite=Strict, HttpOnly, session-only) specifically so the frontend needs zero changes -- the query-string token in the startup URL is only ever needed on the first page load. On by default; --token/PYIDE_TOKEN pin it, --no-auth disables the check entirely.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Merge request reports