Coder: PKCS#7 signature bypass in Azure instance identity allows unauthenticated agent token theft
coder
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| github.com/coder/coder/v2 Go |
|
|
coder
| Product | Affected | Fixed in |
|---|---|---|
| github.com/coder/coder/v2 Go |
|
|
2.31.122.30.82.29.132.24.5| github.com/coder/coder Go |
| No fix yet |
Coder allows organizations to provision remote development environments via Terraform. In versions prior tp 2.24.5, 2.29.13, 2.30.8, 2.31.12, 2.32.2, and 2.33.3, `azureidentity.Validate()` verifies that the PKCS#7 signer certificate chains to a trusted Azure CA but never verifies the PKCS#7 signature itself. An attacker can embed a legitimate Azure certificate alongside arbitrary content e.g. `{"vmId":"<target>"}` and the forged `vmId` will be accepted returning the victim workspace agent's session token. No authentication is required. The attacker only needs to know a target VM's `vmId` which is a `UUIDv4`. That's a practical limitation which would typically require prior access to be exploited. Versions 2.24.5, 2.29.13, 2.30.8, 2.31.12, 2.32.2, and 2.33.3 patch the issue. As a workaround, reconfigure any Azure templates to use token authentication rather than `azure-instance-identity`.
From the CVE record · GitHub_M
Coder's Azure identity validation checks the signer certificate but not the PKCS#7 signature. An unauthenticated attacker who knows a target VM's UUIDv4 vmId can submit forged identity content and obtain the victim workspace agent's session token. Knowing the vmId is a practical limitation that would typically require prior access.
Operators using affected github.com/coder/coder/v2 releases before the applicable fixed version, or any github.com/coder/coder release through 0.27.3, should check their deployments.