Skip to content

v1.18.0

Choose a tag to compare

@github-actions github-actions released this 13 Nov 14:43
· 15 commits to main since this release
v1.18.0
733bf61

This release fixes four security issues where the extension could send your session token, coder.headerCommand headers, or OAuth secrets to a server other than your Coder deployment. Update as soon as possible. It also lets deployments that use TLS client certificates (mTLS) sign in with a session token or OAuth, stops live updates from missing their first message, retries connections that stall, and cancels the old session's requests when you switch accounts.

Warning

This release requires Coder 2.29.0 or later.

Component Minimum version
Coder server 2.29.0
Coder CLI 2.29.0

With an older Coder server or CLI, signing in and connecting to workspaces stop with an upgrade message. If you can't upgrade Coder yet, stay on v1.17.2 for now (Extensions view, right-click Coder, Install Specific Version…), but note that v1.17.2 doesn't have the security fixes below. See Compatibility. (#1186, closes #1180)

🔒 Security

The extension now identifies a deployment by its origin: the scheme, host, and port of its URL. It keeps a separate session for each origin and sends credentials only to that origin. (#1173, #1176, #1177)

Session tokens sent through redirects and custom binary sources (high)

Fixes GHSA-47qp-vp45-fhjf: if your deployment redirected to another server, your session token and coder.headerCommand headers were sent there too. They were also sent on every CLI download from a coder.binarySource on another server. All versions before 1.18.0 are affected.

The extension now:

  • Sends credentials only to the deployment. Requests to any other server, such as a coder.binarySource host, carry no token or headers.
  • Stops at redirects to another origin. API requests, downloads, and WebSockets no longer follow them. With Coder CLI 2.38 or later, the extension also passes --allow-redirects=false to the CLI, which overrides coder.globalFlags and CODER_ALLOW_REDIRECTS.

Session tokens shared across origins on the same host (medium)

Fixes GHSA-x24p-7cw4-4qm4: sessions were stored by hostname, so https://coder.example.com, http://coder.example.com, and https://coder.example.com:8443 shared one session. A token for the HTTPS deployment could be sent unencrypted to the http:// URL, or to a different service on another port. From 1.15.0, signing in to one of them in another window could also switch an open remote session to it. Versions 1.12.0 through 1.17.2 are affected.

The extension now:

  • Stores everything per origin. Sessions, CLI credentials, SSH hosts, and the downloaded CLI are kept separately for each origin.
  • Syncs sign-ins per origin. Open windows and remote sessions pick up sign-ins and sign-outs only for their own origin.

Keyring tokens read for http:// URLs (medium)

Fixes GHSA-g92h-wph3-v9pm: before 2.39.0, the Coder CLI saved keyring entries by host only, so signing in to http://coder.example.com read the token saved for https://coder.example.com and sent it unencrypted. Signing out of the http:// URL also deleted the HTTPS session. Linux isn't affected.

These versions are affected:

  • 1.14.0 on macOS and Windows, where coder.useKeyring is on by default
  • 1.14.1 through 1.16.2 with coder.useKeyring enabled
  • 1.16.3 through 1.17.2 with default settings

The extension now:

  • Uses the keyring for http:// only with Coder CLI 2.39.0 or later. With an older CLI, http:// deployments save their session to a file instead, and a notice tells you. HTTPS deployments keep using the keyring.

OAuth endpoints on other servers (medium)

Fixes GHSA-frg9-9vj4-2v84: the extension trusted any endpoint in the deployment's OAuth configuration, so a tampered response could send OAuth tokens, client secrets, and your session token to another server. Versions 1.12.0 through 1.17.2 are affected when OAuth sign-in is enabled. Session token sign-in isn't affected.

The extension now:

  • Keeps OAuth on the deployment. OAuth sign-in is refused if the deployment's OAuth configuration points to another origin or to a workspace app (/@user/...), and the error names the endpoint. OAuth requests no longer follow redirects to another origin.
  • Shows OAuth errors in a dialog, so text from the server can't show up as a clickable link.

Important

  • Deployments at https:// on the default port, like https://coder.example.com, keep their session. Any other origin, like http://coder.example.com or https://coder.example.com:8443, needs one new sign-in and downloads the Coder CLI again.
  • If your deployment URL redirects to a different address, for example after a domain move or from http:// to https://, sign in with the new URL. The error, or a notice at startup, offers a Sign In to … button.

Highlights

Sign-in with TLS client certificates (mTLS)

Setting coder.tlsCertFile or coder.tlsKeyFile used to skip the session token step, on the assumption that the certificate signs you in. Deployments that use the certificate only to secure the connection, and still need a session token, couldn't sign in. (#1170, fixes #1159)

The extension now tries, in order:

  1. The certificate alone, which still works on deployments where the certificate signs you in.
  2. The Coder CLI's saved token.
  3. The OAuth or session token prompt. Submitting the token prompt empty signs you in on deployments that accept no token.

If the certificate would sign you in as a different user than your previous session, the extension asks first.

Bug fixes

  • Live updates no longer miss their first message. Workspace status, agent metadata, inbox notifications, and build and agent logs started listening only after the connection opened, so a message that arrived with the connection was lost. Listeners are now attached first. Reconnect delays also reset after a successful connection. (#1189, fixes #1141)
  • Stalled connections retry. A WebSocket that the server accepted but never finished setting up hung with no error. It now times out after 60 seconds, like API requests, and reconnects. (#1172)
  • Switching accounts cancels old requests. When you switch to another deployment or account, requests still running for the old one are canceled instead of finishing under the new sign-in. They no longer refresh the token or show a sign-in prompt. Token refreshes for the same account keep requests running. (#1174)
  • OAuth refreshes keep newer credentials. An OAuth token refresh that was canceled midway no longer overwrites the credentials that replaced it. (#1174)
  • No one-minute hang without a token. On deployments where the certificate signs you in, the extension passed an empty token to coder login, which waited a minute and then failed the connection. Remove All in Coder: Manage Credentials also no longer signs the Coder CLI out of these deployments. (#1170)
  • The token prompt keeps your token. If you typed a token, then cleared it or pressed Escape, the extension signed you in without a token. (#1170)
  • Invalid header names fail clearly. If coder.headerCommand prints an invalid header name, connecting now fails with "Malformed line N from header command output". Header names may contain only letters, digits, and !#$%&'*+-.^_`|~. An invisible byte order mark at the start of the output, which PowerShell adds, is ignored. (#1171)
  • Plain text in notifications. VS Code turns [text](link) in a notification into a clickable link. Startup script names, app status messages, and Coder CLI errors now show as plain text. Template version messages and inbox titles keep their http(s):// links, and other links show as plain text. (#1187)
  • Accurate keyring prompt. The "Failed to store credentials" error offered Open Settings for coder.useKeyring even when the keyring wasn't involved. It now offers it only when the Coder CLI fails to save your credentials with the keyring on. (#1186)

Full changelog: v1.17.2...v1.18.0