CVE-2026-126403 in Coder
Summary
by MITRE • 11/13/2026
Coder 2.26.0 before 2.29.24, 2.30.0 before 2.34.16, 2.35.0 before 2.36.11, 2.37.0 before 2.37.8, and 2.38.0 before 2.38.4 contains an improper authorization flaw in the external agent credentials endpoint, which returns the workspace agent token to users with only workspace read access rather than ssh permission. Authenticated users with roles such as Template Admin or Organization Admin can use the token to read the owner's private Git SSH key and Git provider OAuth tokens, and impersonate the agent to receive the owner's sessions.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 11/13/2026
The vulnerability identified in Coder versions 2.26.0 through 2.38.4 represents a critical failure in access control logic within the application’s external agent credentials endpoint. This flaw allows authenticated users with insufficient privileges, specifically those holding only workspace read permissions or roles such as Template Admin and Organization Admin, to retrieve sensitive authentication tokens intended for privileged agents. The core technical issue lies in the improper authorization check performed when generating or returning the workspace agent token. Instead of verifying that the requesting user possesses specific SSH access rights or higher-level administrative privileges required to interact with agent credentials, the system incorrectly grants this information based on broader read-access permissions. This misconfiguration effectively bypasses the intended security boundary between standard users and privileged service accounts, creating a significant avenue for unauthorized data exfiltration and identity impersonation.
The operational impact of this vulnerability is severe due to the high sensitivity of the exposed credentials. The workspace agent token serves as a primary mechanism for agents to communicate with the Coder control plane and manage user sessions. By obtaining this token through the flawed endpoint, an attacker can not only read the owner's private Git SSH keys but also access Git provider OAuth tokens stored within the environment. These credentials are critical for version control operations and integration with external code hosting platforms like GitHub or GitLab. The exposure of these secrets allows malicious actors to clone private repositories, push unauthorized changes, or exfiltrate source code containing proprietary logic and sensitive configuration data. Furthermore, possession of the agent token enables the attacker to impersonate the legitimate agent process. This capability grants the ability to receive and potentially manipulate user sessions associated with that workspace, leading to further compromise of interactive development environments and potential lateral movement within connected infrastructure.
From a classification perspective, this vulnerability aligns directly with CWE-269, which describes Improper Authorization, specifically where an actor is granted privileges they should not possess based on role-based access control failures. It also maps to the MITRE ATT&CK framework under techniques related to Credential Access and Privilege Escalation. The ability to retrieve SSH keys and OAuth tokens corresponds to T1552.004 (Private Keys) and potentially T1556 if used for modifying authentication mechanisms, while impersonating the agent to receive sessions relates to T1136.001 (Create Account: Local Account) or more accurately T1098.004 (Account Manipulation: SSH Authorized Keys) depending on how the token is leveraged to maintain persistence or access. The scenario exemplifies a classic broken object level authorization flaw where the system fails to enforce proper restrictions at the resource level, allowing low-privileged users to interact with high-value assets without adequate verification of their specific permissions for that action.
Mitigation strategies must prioritize immediate version upgrades and strict enforcement of least privilege principles. Organizations running affected versions should upgrade Coder to 2.29.24 or later, depending on the major release branch in use, as these patches correct the authorization logic within the external agent credentials endpoint. Until patching is complete, administrators should audit user roles and permissions to ensure that workspace read access does not inadvertently grant exposure to sensitive credential endpoints. Implementing network-level controls such as firewalls can restrict direct API access if possible, though this is less effective for internal web applications. Additionally, rotating all exposed Git SSH keys and OAuth tokens immediately upon confirmation of potential compromise is essential to mitigate ongoing risk. Long-term remediation involves adopting a zero-trust architecture where every request is verified against explicit permissions rather than relying on broad role definitions that may contain overly permissive defaults. Regular security audits focusing on API endpoint authorization checks can help identify similar flaws in other parts of the application before they are exploited by adversaries seeking to escalate privileges or steal sensitive credentials.