{"id":"GHSA-wcx9-ccpj-hx3c","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://\u003ccoder url\u003e/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","aliases":["GO-2024-3228"],"modified":"2024-10-30T18:50:39Z","published":"2024-10-28T18:31:57Z","database_specific":{"nvd_published_at":null,"cwe_ids":["CWE-601"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2024-10-28T18:31:57Z"},"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"}],"affected":[{"package":{"name":"github.com/coder/coder/v2","ecosystem":"Go","purl":"pkg:golang/github.com/coder/coder/v2"},"ranges":[{"type":"SEMVER","events":[{"introduced":"2.16.0"},{"fixed":"2.16.1"}]}],"versions":["2.16.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-wcx9-ccpj-hx3c/GHSA-wcx9-ccpj-hx3c.json"}},{"package":{"name":"github.com/coder/coder/v2","ecosystem":"Go","purl":"pkg:golang/github.com/coder/coder/v2"},"ranges":[{"type":"SEMVER","events":[{"introduced":"2.15.0"},{"fixed":"2.15.3"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-wcx9-ccpj-hx3c/GHSA-wcx9-ccpj-hx3c.json"}},{"package":{"name":"github.com/coder/coder/v2","ecosystem":"Go","purl":"pkg:golang/github.com/coder/coder/v2"},"ranges":[{"type":"SEMVER","events":[{"introduced":"2.3.1"},{"fixed":"2.14.4"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/10/GHSA-wcx9-ccpj-hx3c/GHSA-wcx9-ccpj-hx3c.json"}}],"schema_version":"1.9.0","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"}]}