{"id":"CVE-2026-46354","aliases":["CVE-2026-46354","GHSA-6x44-w3xg-hqqf","GO-2026-5196"],"related":[],"kind":"vulnerability","state":"published","title":"Coder: PKCS#7 signature bypass in Azure instance identity allows unauthenticated agent token theft","summary":"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`.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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`.","source":"cvelist"},{"lang":"en","text":"## Summary\n\n`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.\n\n**No authentication is required.** The attacker only needs to know a target VM's `vmId` which is a `UUIDv4`.\n> that's a practical limitation which would typically require prior access to be exploited\n\n## Root Cause\n\nIn unpatched Coder releases the signature over the PKCS#7 content is not validated - only the signing certificate is checked.\n\n## Impact\n\nAn attacker on any Azure VM or with access to a publicly available Azure IMDS certificate from CT logs can:\n\n1. **Steal an agent session token** by sending a forged PKCS#7 envelope to `POST /api/v2/workspaceagents/azure-instance-identity` which is unauthenticated.\n2. **With the stolen token** access:\n   - **Git SSH private key** via `GET /workspaceagents/me/gitsshkey`: push to repositories and impersonate the workspace owner.\n   - **OAuth access tokens** via `GET /workspaceagents/me/external-auth`: GitHub, GitLab, and Bitbucket tokens in plaintext.\n   - **Workspace secrets** via the agent manifest: environment variables, file paths, and API keys.\n\n## Attack Path Diagram\n\n<img width=\"5588\" height=\"4176\" alt=\"PKCS7_diagram (1)\" src=\"https://github.com/user-attachments/assets/74e88a89-a995-450d-87ab-6feed03579a5\" />\n\n## Affected Versions\n\nAll versions of Coder v2 are affected.\n\n## Patches\n\nFixed in [#25286 ](https://github.com/coder/coder/pull/25286)\n\nThe fix was backported to all supported release lines:\n\n| Patched Versions |\n| --- |\n| [**v2.33.3**](https://github.com/coder/coder/releases/tag/v2.33.3) |\n| [**v2.32.2**](https://github.com/coder/coder/releases/tag/v2.32.2) |\n| [**v2.31.12**](https://github.com/coder/coder/releases/tag/v2.31.12) |\n| [**v2.30.8**](https://github.com/coder/coder/releases/tag/v2.30.8) |\n| [**v2.29.13**](https://github.com/coder/coder/releases/tag/v2.29.13) |\n| [**v2.24.5**](https://github.com/coder/coder/releases/tag/v2.24.5) |\n\n## Workarounds\n\nIf unable to patch we recommend immediately reconfiguring any Azure templates to use token authentication rather than `azure-instance-identity` until the patch is released and you are fully upgraded.\n\n1. Modify the [`coder_agent.auth`](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/agent#auth-1) value to be `token`.\n2. Add `CODER_AGENT_TOKEN=${coder_agent.main.token}` to the set of environment variables for the Coder Workspace Agent initialization script.\n\n## Recognition\n\nWe'd like to thank [Ben Tran](https://github.com/bencalif) of [calif.io](http://calif.io) and Anthropic’s Security Team (`ANT-2026-22445`) for independently disclosing this issue!","format":"markdown","source":"ghsa"},{"lang":"en","text":"Coder: PKCS#7 signature bypass in Azure instance identity allows unauthenticated agent token theft in github.com/coder/coder","format":"markdown","source":"go"}],"published":"2026-05-19T20:04:13.000Z","modified":"2026-07-08T19:47:02.427Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-347"],"affected":[{"ranges":[{"version":">= 2.33.0-rc.0, < 2.33.3","status":"affected"},{"version":">= 2.32.0-rc.0, < 2.32.2","status":"affected"},{"version":">= 2.31.0, < 2.31.12","status":"affected"},{"version":">= 2.30.0, < 2.30.8","status":"affected"},{"version":">= 2.29.0, < 2.29.13","status":"affected"},{"version":"< 2.24.5","status":"affected"}],"vendor":"coder","product":"coder","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.33.0-rc.0","status":"affected","fixed":"2.33.3"}],"ecosystem":"Go","package":"github.com/coder/coder/v2","purl":"pkg:golang/github.com/coder/coder/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.32.0-rc.0","status":"affected","fixed":"2.32.2"}],"ecosystem":"Go","package":"github.com/coder/coder/v2","purl":"pkg:golang/github.com/coder/coder/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.31.0","status":"affected","fixed":"2.31.12"}],"ecosystem":"Go","package":"github.com/coder/coder/v2","purl":"pkg:golang/github.com/coder/coder/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.30.0","status":"affected","fixed":"2.30.8"}],"ecosystem":"Go","package":"github.com/coder/coder/v2","purl":"pkg:golang/github.com/coder/coder/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.29.0","status":"affected","fixed":"2.29.13"}],"ecosystem":"Go","package":"github.com/coder/coder/v2","purl":"pkg:golang/github.com/coder/coder/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.24.5"}],"ecosystem":"Go","package":"github.com/coder/coder/v2","purl":"pkg:golang/github.com/coder/coder/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.27.3"}],"ecosystem":"Go","package":"github.com/coder/coder","purl":"pkg:golang/github.com/coder/coder","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/coder/coder","purl":"pkg:golang/github.com/coder/coder","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.24.5"},{"type":"semver","introduced":"2.29.0","status":"affected","fixed":"2.29.13"},{"type":"semver","introduced":"2.30.0","status":"affected","fixed":"2.30.8"},{"type":"semver","introduced":"2.31.0","status":"affected","fixed":"2.31.12"},{"type":"semver","introduced":"2.32.0-rc.0","status":"affected","fixed":"2.32.2"},{"type":"semver","introduced":"2.33.0-rc.0","status":"affected","fixed":"2.33.3"}],"ecosystem":"Go","package":"github.com/coder/coder/v2","purl":"pkg:golang/github.com/coder/coder/v2","source":"go"},{"ranges":[{"status":"affected","fixed":"2.24.5"},{"status":"affected","introduced":"2.29.0","fixed":"2.29.13"},{"status":"affected","introduced":"2.30.0","fixed":"2.30.8"},{"status":"affected","introduced":"2.31.0","fixed":"2.31.12"},{"status":"affected","introduced":"2.32.0","fixed":"2.32.2"},{"status":"affected","introduced":"2.33.0","fixed":"2.33.3"}],"vendor":"coder","product":"coder","cpe":"cpe:2.3:a:coder:coder:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/coder/coder/security/advisories/GHSA-6x44-w3xg-hqqf","tags":["advisory","patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/coder/coder/pull/25286","tags":["fix","issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/coder/coder/releases/tag/v2.24.5","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/coder/coder/releases/tag/v2.29.13","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/coder/coder/releases/tag/v2.30.8","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/coder/coder/releases/tag/v2.31.12","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/coder/coder/releases/tag/v2.32.2","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/coder/coder/releases/tag/v2.33.3","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/coder/coder","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-07-08T13:01:18.394Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-46354","url":"https://www.cve.org/CVERecord?id=CVE-2026-46354","licence":"CVE Terms of Use","modified":"2026-07-08T13:01:25.192Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6x44-w3xg-hqqf","url":"https://github.com/advisories/GHSA-6x44-w3xg-hqqf","licence":"CC-BY-4.0","modified":"2026-06-25T19:56:36.115Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5196","url":"https://pkg.go.dev/vuln/GO-2026-5196","licence":"CC-BY-4.0","modified":"2026-06-25T19:45:15.243Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-46354","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-46354","licence":"Public domain","modified":"2026-07-08T19:47:02.427Z"}],"updatedAt":"2026-11-25T22:59:27.321Z","epss":{"score":0.00364,"percentile":0.32251,"date":"2026-12-01T12:00:22.000Z"}}