GHSA-3rw9-wmc8-8948: Github.com/coder/coder/v2 Coder Accepts An APIKey Beyond Vulnerability

LOW
CWE-324
Published
Advisory Summary

GHSA-3rw9-wmc8-8948 is a LOW coder accepts an apikey beyond vulnerability (CWE-324: Use of a Key Past its Expiration Date) affecting Github.com/coder/coder/v2 libraries in the Go ecosystem. The issue involves coder accepts an apikey beyond the linked oidc expiry if there is no refresh token. Remediation is available by upgrading affected packages to version 2.23.0.

GHSA-3rw9-wmc8-8948 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-3rw9-wmc8-8948
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-324: Use of a Key Past its Expiration Date
Affected Product Github.com/coder/coder/v2
Package Ecosystem Go
Published Date
Last Updated

How to Fix GHSA-3rw9-wmc8-8948

To remediate this vulnerability, upgrade all affected Github.com/coder/coder/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/coder/coder/v2 fixed: 2.23.0
Upgrade github.com/coder/coder/v2 to 2.23.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/coder/coder/v2

How to Check if You Are Affected

To determine whether your application is affected by GHSA-3rw9-wmc8-8948, inspect your project dependencies for Github.com/coder/coder/v2:

inspect dependencies for github.com/coder/coder/v2

Analyze the terminal output to locate any version of Github.com/coder/coder/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.23.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-324: Use of a Key Past its Expiration Date, where the product uses a cryptographic key or password past its expiration date, which diminishes its safety significantly by increasing the timing window for cracking attacks against that key. In Github.com/coder/coder/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary If users log in to Coder via OIDC, and the OpenID Identity Provider does not return a refresh token, then Coder may allow their web session to continue beyond the expiration of the token returned by the OpenID Identity Provider. ### Details When a user logs in via OIDC, Coder stores the OIDC token and refresh token (if any) in its datastore and sets an APIKey in the user's cookies. If there is a refresh token, then when the OIDC token is expired and a request is made with the APIKey, we attempt to refresh the OIDC token. If refresh fails, the Coder API request is also failed and the user needs to log in again. However, if there is no refresh token provided, then affected versions of Coder fail to enforce the expiry of the OIDC token, and allow users to make API requests even if it is expired so long as their APIKey stored in cookies has not expired. Coder APIKeys have an expiry and lifetime of 24 hours, but Coder is configured to extend the lifetime of the APIKey by up to 24 hours from the time it is used successfully. So, an APIKey that is used at least once every 24 hours will not expire. (This behavior can be disabled by configuration). ### Impact This could allow a user to access the Coder service beyond the lifetime of the token issued by the OpenID provider, potentially indefinitely, even if they are no loner authorized via OIDC.

GHSA-3rw9-wmc8-8948 Affected Github.com/coder/coder/v2 Versions

1 component(s)
Fixed Versions:
2.23.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/coder/coder/v2
Go
< 2.23.0
2.23.0

References

Frequently Asked Questions

What is GHSA-3rw9-wmc8-8948?
GHSA-3rw9-wmc8-8948 is a security vulnerability in Github.com/coder/coder/v2 involving Coder accepts an APIKey beyond the linked OIDC expiry if there is no refresh token under CWE-324: Use of a Key Past its Expiration Date.
Which Github.com/coder/coder/v2 versions are affected?
Affected versions include releases prior to 2.23.0 across affected packages: github.com/coder/coder/v2.
What version fixes GHSA-3rw9-wmc8-8948?
Upgrading to 2.23.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/coder/coder/v2 affected?
Yes, github.com/coder/coder/v2 is affected in releases prior to 2.23.0. Upgrade your dependency to 2.23.0 or later.
What CWE is associated with GHSA-3rw9-wmc8-8948?
GHSA-3rw9-wmc8-8948 is classified under CWE-324: Use of a Key Past its Expiration Date (The product uses a cryptographic key or password past its expiration date, which diminishes its safety significantly by increasing the timing window for cracking attacks against that key.).
How can I check Go dependencies for GHSA-3rw9-wmc8-8948?
Run the dependency tree command: 'inspect dependencies for github.com/coder/coder/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3rw9-wmc8-8948",
  "modified" : "2025-08-28T19:36:05Z",
  "published" : "2025-08-28T19:36:04Z",
  "aliases" : [ ],
  "summary" : "Coder accepts an APIKey beyond the linked OIDC expiry if there is no refresh token",
  "details" : "### Summary\nIf users log in to Coder via OIDC, and the OpenID Identity Provider does not return a refresh token, then Coder may allow their web session to continue beyond the expiration of the token returned by the OpenID Identity Provider.\n\n### Details\nWhen a user logs in via OIDC, Coder stores the OIDC token and refresh token (if any) in its datastore and sets an APIKey in the user's cookies. If there is a refresh token, then when the OIDC token is expired and a request is made with the APIKey, we attempt to refresh the OIDC token. If refresh fails, the Coder API request is also failed and the user needs to log in again.\n\nHowever, if there is no refresh token provided, then affected versions of Coder fail to enforce the expiry of the OIDC token, and allow users to make API requests even if it is expired so long as their APIKey stored in cookies has not expired.\n\nCoder APIKeys have an expiry and lifetime of 24 hours, but Coder is configured to extend the lifetime of the APIKey by up to 24 hours from the time it is used successfully. So, an APIKey that is used at least once every 24 hours will not expire. (This behavior can be disabled by configuration). \n\n### Impact\nThis could allow a user to access the Coder service beyond the lifetime of the token issued by the OpenID provider, potentially indefinitely, even if they are no loner authorized via OIDC.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/coder/coder/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.23.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/coder/coder/security/advisories/GHSA-3rw9-wmc8-8948"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/coder/coder/commit/1a4160803589034ce1518e24a78f232c8d08f996"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/coder/coder"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-324" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-08-28T19:36:04Z",
    "nvd_published_at" : null
  }
}