Skip to content

fix: only inject session tokens into trusted app links - #31208

Merged
EhabY merged 2 commits into
mainfrom
fix/site-app-token-destination
Oct 23, 2026
Merged

EhabY merged 2 commits into
mainfrom
fix/site-app-token-destination

Conversation

@EhabY

@EhabY EhabY commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

External app links that use $SESSION_TOKEN now receive a session token only when they open a known Coder IDE handler and point to this deployment.

  1. Destination check. The token is filled in only when the link starts with a known handler (<scheme>://coder.coder-remote/open or /openDevContainer, jetbrains://gateway/coder or /com.coder.toolbox, or jetbrains-gateway://connect#type=coder), has exactly one url param that is this deployment's bare origin (dashboard origin or access URL), and the placeholder is the token value. Links with a non-standard shape are rejected. Other links mint no key and render disabled with a tooltip.
  2. Sub-agent apps never get a token, like coder open app. Links to this deployment open with an empty token.
  3. .devcontainer: drop the now unused placeholder from the Cursor and Windsurf links.
  4. Messages: blocked links say "This app's URL isn't trusted to sign you in to Coder." Tooltips point dev container apps to devcontainer.json and template apps to the template administrator.

Behavior changes

  • Token links with another handler, a different url, or a non-standard shape are disabled. Registry IDE modules are unaffected.
  • Dev container apps using $SESSION_TOKEN open without a token, so the IDE signs in once.
  • Templates that set provider "coder" { url = ... } to a different host get their IDE links blocked.

Backports: #31209 (2.38), #31210 (2.37), #31211 (2.36), #31212 (2.34), #31214 (2.29).

Generated with Coder Agents.

External app links that use `$SESSION_TOKEN` now receive a session
token only when they open a known Coder IDE handler and point to this
deployment. Other links mint no key and render disabled with a tooltip.
Sub-agent apps never get a token.
@EhabY
EhabY enabled auto-merge (squash) October 23, 2026 18:30
@EhabY
EhabY merged commit 43ecc7c into main Oct 23, 2026
26 of 27 checks passed
@EhabY
EhabY deleted the fix/site-app-token-destination branch October 23, 2026 18:33
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 23, 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.

3 participants