Commit Graph
3 Commits
Author SHA1 Message Date
dylanhuff-at-coderandClaude Opus 5.5 8efd1fc86e fix(coderd/workspaceapps)!: strip session tokens before proxying to apps (#31633)
The workspace app proxy stripped Coder cookies before forwarding a
request to the app, but not the `Coder-Session-Token` header or the
`coder_session_token` query parameter. App auth accepts both, so a
client that authenticated that way (the CLI and codersdk, or an IDE
extension pointed at a path app URL) passed its API key through to
whatever runs behind the app. That matters most for shared apps and
ports, where the caller's token reached a workspace owned by someone
else.

This strips both before proxying. The query parameter is removed from
the raw query string, so everything else in the query reaches the app
byte-for-byte. `Authorization` and `access_token` are still forwarded
since apps can use them for their own auth. Stripping those safely needs
to know which credential Coder actually used, so that's tracked in
[CORE-817](https://linear.app/codercom/issue/CORE-817/strip-authorization-and-access-token-from-app-proxy-requests-when).

This is marked breaking because an app that relied on the caller's Coder
token arriving through that header or query param won't get it anymore.
Cookie-authenticated requests were already covered, so this only affects
callers that send the token in that header or query param. Nothing in
this repo depends on it. Apps that need to call the Coder API as the
visitor should use the OAuth2 provider instead.

Covered by the shared app proxy tests, which run against coderd and
wsproxy, for both the owner on a path app and another user on a shared
subdomain app, plus unit tests for the query filtering.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 09:59:50 -08:00
Bobby Ho 603dd420d1 feat: add ServerTailnet logs and metrics for unreachable agents (#30133)
Add default-level metrics and warn-level diagnostics to investigate
ServerTailnet reachability failures causing agent-specific 502s, without
restarting coderd or enabling debug logging.

- Enrich request logs and PTY/chatd warnings with agent ID, failure
  reason, wait duration, coordinator state, WireGuard handshake and
  byte counts, and DERP regions.
- Add metrics for unreachable attempts by reason, reachability latency,
  embedded DERP connections, and offline app/terminal requests.
- Distinguish reachability failures from subsequent TCP dial failures,
  cap reverse proxy dials at one minute, and exclude expected chatd
  readiness polls and superseded-agent dials from unreachable counts.
- Report missing handshakes as zero time instead of 1970, also fixing
  `coder ping`.

Part of PLAT-680, a sub-issue of PLAT-360.
2026-10-14 14:55:29 -07:00
Jon Ayers 7e7a6b4f18 fix: prevent open redirect in proxy authentication flow (#26647) 2026-06-25 11:17:23 -05:00