# CVE-2025-58437: Coder's privilege escalation vulnerability could lead to a cross workspace compromise

> Attackers can exploit unexpired session tokens in prebuilt workspaces to gain unauthorized access to other users' development environments.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Sep 2025
- **Updated:** 8 Sep 2025
- **Also known as:** GHSA-j6xf-jwrj-v5qp, GO-2025-3938

## What is CVE-2025-58437?

CVE-2025-58437 is a high-severity vulnerability in coder, published on 6 Sep 2025. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Coder allows organizations to provision remote development environments via Terraform. In versions 2.22.0 through 2.24.3, 2.25.0  and 2.25.1, Coder can be compromised through insecure session handling in prebuilt workspaces. Coder automatically generates a session token for a user when a workspace is started. It is automatically exposed via coder_workspace_owner.session_token. Prebuilt workspaces are initially owned by a built-in prebuilds system user. When a prebuilt workspace is claimed, a new session token is generated for the user that claimed the workspace, but the previous session token for the prebuilds user was not expired. Any Coder workspace templates that persist this automatically generated session token are potentially impacted. This is fixed in versions 2.24.4 and 2.25.2.

Weakness: CWE-613 (DEPRECATED: Insufficient Session Expiration), CWE-279 (Incorrect Execution-Assigned Permissions), CWE-277 (Insecure Inherited Permissions)

## Which versions are affected by CVE-2025-58437?

6 open source packages ship an affected version, including github.com/coder/coder/v2 and github.com/coder/coder. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/coder/coder/v2` | Go | From 2.22.0 | 2.24.4, 2.25.2 |
| `github.com/coder/coder/v2` | Go | From 2.22.0 | 2.24.4 |
| `github.com/coder/coder/v2` | Go | From 2.22.0 | 2.24.4 |
| `github.com/coder/coder/v2` | Go | From 2.25.0 | 2.25.2 |
| `github.com/coder/coder/v2` | Go | From 2.25.0 | 2.25.2 |
| `github.com/coder/coder` | Go | All versions | None |

Products: Coder Coder.

## How do I fix CVE-2025-58437?

Upgrade github.com/coder/coder/v2 to a fixed version for your release line: 2.24.4 or 2.25.2.

## Is CVE-2025-58437 being exploited?

There is no known exploitation of CVE-2025-58437 in the wild and no public exploit code.

## Other vulnerabilities in coder

- [CVE-2026-46354](https://insights.sbomify.com/CVE-2026-46354/): Coder: PKCS#7 signature bypass in Azure instance identity allows unauthenticated agent token theft (critical 9.1)
- [CVE-2026-55429](https://insights.sbomify.com/CVE-2026-55429/): Coder's workspace app upsert allows cross-workspace agent rebinding via user-controlled app ID (high 8.7)
- [CVE-2026-55427](https://insights.sbomify.com/CVE-2026-55427/): Coder vulnerable to SSH config injection via unsanitized server-supplied values in `coder config-ssh` (high 8.3)
- [CVE-2026-55428](https://insights.sbomify.com/CVE-2026-55428/): Coder: Route hijacking through lack of validation of agent-supplied AllowedIPs in tailnet coordinator (high 8.2)
- [CVE-2024-27918](https://insights.sbomify.com/CVE-2024-27918/): Coder's OIDC authentication allows email with partially matching domain to register (high 8.2)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-58437 and fix it if it is affected.

What it is: CVE-2025-58437 is a high-severity vulnerability in coder, published on 6 Sep 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-58437 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/coder/coder/v2 (Go): affected from 2.22.0; fixed in 2.24.4, 2.25.2
- github.com/coder/coder/v2 (Go): affected from 2.22.0; fixed in 2.24.4
- github.com/coder/coder/v2 (Go): affected from 2.22.0; fixed in 2.24.4
- github.com/coder/coder/v2 (Go): affected from 2.25.0; fixed in 2.25.2
- github.com/coder/coder/v2 (Go): affected from 2.25.0; fixed in 2.25.2
- github.com/coder/coder (Go): affected all versions; no fix listed

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-58437/ (Markdown: https://insights.sbomify.com/CVE-2025-58437/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-58437
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-58437
- OSV: https://osv.dev/vulnerability/CVE-2025-58437

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-58437/
Summaries are generated and may contain mistakes; the official description above is the record.
