/

CVE-2026-55429

Severity:

HIGH RISK

(8.7)

Broken Access Control (CWE-639) in Coder Workspace Apps

CVE-2026-55429

Analyzed

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-639

Impact:

Cross-Workspace Unauthorized Resource Modification

Severity:

HIGH RISK

(8.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A broken access control flaw in Coder's workspace app provisioning logic allows a privileged template author or external provisioner operator to reassign app agents across workspaces.

By abusing how UpsertWorkspaceApp and insertAgentApp handle app IDs without validating workspace ownership, an attacker can perform unauthorized cross-workspace modifications during Terraform-based environment creation.

Affected context

This vulnerability occurs in Coder deployments that use Terraform-based remote development environment provisioning and rely on UpsertWorkspaceApp and insertAgentApp to manage workspace applications.

It is relevant when:

  • Workspaces are created or updated via provisioners using CompleteJob flows
  • Template authors or external provisioner operators have elevated configuration or operational access
  • The system permits app IDs to be supplied in job completion payloads without strict ownership checks

Exploit preconditions

  • Attack surface: Internal service APIs involved in workspace provisioning (CompleteJob, UpsertWorkspaceApp, insertAgentApp)
  • Required access: Elevated permissions as a template author or external provisioner operator with the ability to influence CompleteJob payloads
  • Trigger point: Submission of a crafted CompleteJob payload that references an app ID from a different workspace, causing UpsertWorkspaceApp to overwrite the agent_id field
  • Why exploitation is possible: The authorization layer runs under dbauthz.AsProvisionerd, and the logic does not verify that an app ID belongs to the workspace being built, enabling cross-workspace agent reassignment on primary-key conflicts

Why this happens

The underlying bug stems from insufficient object-level authorization and ownership validation in workspace app management routines.

Specifically, insertAgentApp trusts the app ID supplied in the provisioner's CompleteJob payload, and UpsertWorkspaceApp overwrites the existing app's agent_id on a primary-key conflict without confirming the app is part of the current workspace.

This behavior maps to CWE-639: Insecure Direct Object Reference, where internal identifiers are accepted and acted upon without validating that the caller is authorized for the referenced resource.

Potential impact

  • Cross-workspace reassignment of app agents that may affect execution context or connectivity
  • Unauthorized modification of another workspace's configuration and associated runtime behavior
  • Potential indirect access to data or services reachable via the reassigned agent
  • Disruption of targeted developers' environments and reliability of remote development workflows

General mitigation guidance

Mitigation generally focuses on enforcing strict resource ownership checks and hardening authorization boundaries around provisioning flows.

Recommended defensive patterns include:

  • Validating that any app or agent IDs supplied by provisioners belong to the workspace being constructed before performing upsert operations
  • Implementing object-level authorization checks in application logic instead of relying solely on broad role-based contexts like AsProvisionerd
  • Treating internal identifiers from external systems as untrusted and confirming referential integrity against the workspace scope
  • Limiting the effective privileges of template authors and provisioner operators to the workspaces they are intended to manage
  • Designing provisioning APIs to avoid side effects on resources outside the current workspace or tenant

How teams detect issues like this

Detection can rely on both runtime and code-level analysis.

Common approaches include:

  • Reviewing provisioning and upsert code paths for missing ownership validation when handling IDs such as workspace apps, agents, or similar resources
  • Adding logging and monitoring for CompleteJob operations that reference app IDs not originally associated with the workspace being built
  • Implementing database-level or application-level integrity checks that flag cross-workspace references or unexpected changes to agent_id fields
  • Using static analysis or automated code review tools to identify direct object references that lack associated authorization or workspace scope checks

Sources

SourceLink
github.comgithub.com/coder/coder/pull/26103
github.comgithub.com/coder/coder/releases/tag/v2.29.17
github.comgithub.com/coder/coder/releases/tag/v2.32.7
github.comgithub.com/coder/coder/releases/tag/v2.33.8
github.comgithub.com/coder/coder/releases/tag/v2.34.2
github.comgithub.com/coder/coder/security/advisories/GHSA-9rjw-3gwp-f59v

Frequently asked

questions

Exploitation is constrained to users with elevated roles, such as template authors or external provisioner operators, who can influence CompleteJob payloads. It is not typically exploitable by regular end users.

An attacker must have privileged access to the provisioning pipeline, including the ability to submit or modify job completion data for workspace builds. Without such access, cross-workspace app agent reassignment is unlikely.

The most robust fix is to ensure that all resource identifiers (such as app IDs) used in provisioning flows are validated for ownership against the current workspace or tenant before upsert or update, combined with strict object-level authorization checks.

Future prevention should focus on designing APIs with clear workspace and tenant scoping, treating all IDs from external or semi-trusted systems as untrusted input, enforcing strong access control at the object level, and incorporating security reviews and automated checks into the development and provisioning pipeline.

Find out what's already
exploitable in your codebase.