Coder: Workspace agent API insecure redirect handling allowed cross-agent file read and write
coder
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/coder/coder/v2 Go |
|
|
coder
| Product | Affected | Fixed in |
|---|---|---|
| github.com/coder/coder/v2 Go |
|
|
| github.com/coder/coder Go |
| No fix yet |
Coder allows organizations to provision remote development environments via Terraform. Prior to 2.29.19, 2.32.9, 2.33.10, and 2.34.4, agentConn.apiClient() follows redirects while its custom transport accepts the host from the redirected request URL when the port is the workspace agent HTTP API port 4. An authenticated user who controls a modified workspace agent and knows another online agent's UUID can derive the victim's tailnet address and redirect control-plane requests to that agent. HTTP 301, 302, and 303 redirects can redirect read requests, while HTTP 307 and 308 preserve replayable write and process-start requests. The redirected workspace agent file APIs can read or write files as the victim workspace user, and affected versions exposing the workspace agent process API can execute commands after a redirected file write, crossing workspace and tenant boundaries. This issue is fixed in versions 2.29.19, 2.32.9, 2.33.10, and 2.34.4.
From the CVE record · GitHub_M
Coder’s agentConn.apiClient() can follow redirects from a modified workspace agent to another online agent. An authenticated user who controls the modified agent and knows the other agent’s UUID can read or write files as that workspace user and, in affected versions exposing the process API, execute commands after a redirected file write.
Teams running Go github.com/coder/coder/v2 in the affected 2.27.0–2.34.3 ranges, or any version of Go github.com/coder/coder, should check their deployments.