GHSA-wcx9-ccpj-hx3c: Github.com/coder/coder/v2 Coder Vulnerable To Post-auth URL Vulnerability

MODERATE
CVSS 4.3
CWE-601
Published
Advisory Summary

GHSA-wcx9-ccpj-hx3c is a MODERATE (CVSS 4.3) coder vulnerable to post-auth url vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Github.com/coder/coder/v2 libraries in the Go ecosystem. The issue involves coder vulnerable to post-auth url redirection to untrusted site ('open redirect'). Remediation is available by upgrading affected packages to version 2.16.1, 2.15.3, 2.14.4.

GHSA-wcx9-ccpj-hx3c at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-wcx9-ccpj-hx3c
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Github.com/coder/coder/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-wcx9-ccpj-hx3c

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.16.1
Upgrade github.com/coder/coder/v2 to 2.16.1
github.com/coder/coder/v2 fixed: 2.15.3
Upgrade github.com/coder/coder/v2 to 2.15.3
github.com/coder/coder/v2 fixed: 2.14.4
Upgrade github.com/coder/coder/v2 to 2.14.4
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-wcx9-ccpj-hx3c, 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.16.1), 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-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. 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 An issue on Coder's login page allows attackers to craft a Coder URL that when clicked by a logged in user could redirect them to a website the attacker controls, e.g. https://google.com. ### Details On the login page, Coder checks for the presence of a `redirect` query parameter. On successful login, the user would be redirected to the location of the parameter. Improper sanitization allows attackers to specify a URL outside of the Coder application to redirect users to. ### Impact Coder users could potentially be redirected to a untrusted website if tricked into clicking a URL crafted by the attacker. Coder authentication tokens are **not** leaked to the resulting website. To check if your deployment is vulnerable, visit the following URL for your Coder deployment: - `https://<coder url>/login?redirect=https%3A%2F%2Fcoder.com%2Fdocs` ### Patched Versions This vulnerability is remedied in - v2.16.1 - v2.15.3 - v2.14.4 All versions prior to 2.3.1 are not affected. ### Thanks - https://github.com/jchristov ### References https://github.com/coder/coder/security/advisories/GHSA-wcx9-ccpj-hx3c https://github.com/coder/coder/commit/69c1d981e3131e50d52b01f6a360abadaad699e6

GHSA-wcx9-ccpj-hx3c Affected Github.com/coder/coder/v2 Versions

3 component(s)
Fixed Versions:
2.16.12.15.32.14.4
Product / Package Ecosystem Affected Versions Fixed Version
github.com/coder/coder/v2
Go
≥ 2.16.0
< 2.16.1
All 1 versions
2.16.0
2.16.1
github.com/coder/coder/v2
Go
≥ 2.15.0
< 2.15.3
2.15.3
github.com/coder/coder/v2
Go
≥ 2.3.1
< 2.14.4
2.14.4

References

Frequently Asked Questions

What is GHSA-wcx9-ccpj-hx3c?
GHSA-wcx9-ccpj-hx3c is a security vulnerability in Github.com/coder/coder/v2 involving Coder vulnerable to post-auth URL redirection to untrusted site ('Open Redirect') under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Github.com/coder/coder/v2 versions are affected?
Affected versions include releases prior to 2.16.1, 2.15.3, 2.14.4 across affected packages: github.com/coder/coder/v2.
What version fixes GHSA-wcx9-ccpj-hx3c?
Upgrading to 2.16.1, 2.15.3, 2.14.4 (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.16.1, 2.15.3, 2.14.4. Upgrade your dependency to 2.16.1, 2.15.3, 2.14.4 or later.
What is the CVSS score of GHSA-wcx9-ccpj-hx3c?
GHSA-wcx9-ccpj-hx3c has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N.
What CWE is associated with GHSA-wcx9-ccpj-hx3c?
GHSA-wcx9-ccpj-hx3c is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check Go dependencies for GHSA-wcx9-ccpj-hx3c?
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-wcx9-ccpj-hx3c",
  "modified" : "2024-10-30T18:50:39Z",
  "published" : "2024-10-28T18:31:57Z",
  "aliases" : [ ],
  "summary" : "Coder vulnerable to post-auth URL redirection to untrusted site ('Open Redirect')",
  "details" : "### Summary\nAn issue on Coder's login page allows attackers to craft a Coder URL that when clicked by a logged in user could redirect them to a website the attacker controls, e.g. https://google.com.\n\n### Details\nOn the login page, Coder checks for the presence of a `redirect` query parameter. On successful login, the user would be redirected to the location of the parameter. Improper sanitization allows attackers to specify a URL outside of the Coder application to redirect users to.\n\n### Impact\nCoder users could potentially be redirected to a untrusted website if tricked into clicking a URL crafted by the attacker. Coder authentication tokens are **not** leaked to the resulting website.\n\nTo check if your deployment is vulnerable, visit the following URL for your Coder deployment:\n- `https://<coder url>/login?redirect=https%3A%2F%2Fcoder.com%2Fdocs`\n\n### Patched Versions\nThis vulnerability is remedied in\n- v2.16.1\n- v2.15.3\n- v2.14.4\n\nAll versions prior to 2.3.1 are not affected.\n\n### Thanks\n- https://github.com/jchristov\n\n### References\nhttps://github.com/coder/coder/security/advisories/GHSA-wcx9-ccpj-hx3c\nhttps://github.com/coder/coder/commit/69c1d981e3131e50d52b01f6a360abadaad699e6",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:A/AC:L/AT:N/PR:N/UI:P/VC:N/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" : "2.16.0"
      }, {
        "fixed" : "2.16.1"
      } ]
    } ],
    "versions" : [ "2.16.0" ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/coder/coder/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.15.0"
      }, {
        "fixed" : "2.15.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/coder/coder/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.1"
      }, {
        "fixed" : "2.14.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/coder/coder/security/advisories/GHSA-wcx9-ccpj-hx3c"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/coder/coder/commit/69c1d981e3131e50d52b01f6a360abadaad699e6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/coder/coder"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-10-28T18:31:57Z",
    "nvd_published_at" : null
  }
}