Skip to content

fix(coderd/workspaceapps): verify workspace owner matches app username#26085

Merged
geokat merged 2 commits into
mainfrom
george/plat-260/1-minimal-fix
Jun 10, 2026
Merged

fix(coderd/workspaceapps): verify workspace owner matches app username#26085
geokat merged 2 commits into
mainfrom
george/plat-260/1-minimal-fix

Conversation

@geokat

@geokat geokat commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

A workspace app resolved by workspace UUID never reconciled the URL's username segment against the resolved workspace's owner. A user could serve their own workspace app from a hostname embedding another user's username, so the origin username parsed for the CORS check belonged to the victim. Combined with the username-equality CORS check, this allowed credentialed cross-origin reads of the victim's workspace app responses.

This PR is the minimum fix for the vulnerability: reject the request with a 404 when the resolved workspace's owner does not match the user named in the URL. On its own this closes the hole, since an attacker can no longer serve content from a hostname carrying the victim's username.

Refs: https://linear.app/codercom/issue/PLAT-260


This PR is part of a stack that merges into main:

  1. fix(coderd/workspaceapps): verify workspace owner matches app username #26085 👈
  2. fix: base workspace-app CORS on resolved owner instead of URL username #26086

Created with stakk

@linear-code

linear-code Bot commented Jun 5, 2026

Copy link
Copy Markdown

PLAT-260

When resolving a workspace app by workspace UUID, the URL's username
segment was never reconciled against the resolved workspace's owner.
A user could serve their own workspace app from a hostname embedding
another user's username, so the parsed origin username belonged to the
victim.  Combined with the username-equality CORS check, this allowed
credentialed cross-origin reads of the victim's app responses.

Reject the request with a 404 when the resolved workspace's owner does
not match the user named in the request.

Refs: https://linear.app/codercom/issue/PLAT-260
@geokat geokat force-pushed the george/plat-260/1-minimal-fix branch from 510ba49 to c773cce Compare June 8, 2026 20:38
@geokat geokat marked this pull request as ready for review June 8, 2026 21:40
@geokat geokat requested a review from deansheather June 8, 2026 22:03
They are now the sole line of defense since we decided not to merge #26086 (defense-in-depth)
@geokat geokat merged commit 0b99e67 into main Jun 10, 2026
48 of 50 checks passed
@geokat geokat deleted the george/plat-260/1-minimal-fix branch June 10, 2026 23:26
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 10, 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