{"id":"BIT-oauth2-proxy-2021-21291","revision":null,"records":[{"revision":"49ef642783db4849af2e451f53e0dbe0","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2021-21291","aliases":[],"title":"Subdomain checking of whitelisted domains could allow unintended redirects","description":"OAuth2 Proxy is an open-source reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others) to validate accounts by email, domain or group. In OAuth2 Proxy before version 7.0.0, for users that use the whitelist domain feature, a domain that ended in a similar way to the intended domain could have been allowed as a redirect. For example, if a whitelist domain was configured for \".example.com\", the intention is that subdomains of example.com are allowed. Instead, \"example.com\" and \"badexample.com\" could also match. This is fixed in version 7.0.0 onwards. As a workaround, one can disable the whitelist domain feature and run separate OAuth2 Proxy instances for each subdomain.","state":0,"publishedAt":"2021-02-02T19:05:18+00:00","modifiedAt":"2024-08-03T18:09:15.152+00:00","affected":[{"ecosystem":"Vendor product","name":"oauth2-proxy","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"product\": \"oauth2-proxy\",\n                    \"vendor\": \"oauth2-proxy\",\n                    \"versions\": [\n                        {\n                            \"status\": \"affected\",\n                            \"version\": \"< 7.0.0\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"severity":"MEDIUM"}],"references":["https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-4mf2-f3wh-gvf2","https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.0.0","https://pkg.go.dev/github.com/oauth2-proxy/oauth2-proxy/v7","https://github.com/oauth2-proxy/oauth2-proxy/commit/780ae4f3c99b579cb2ea9845121caebb6192f725"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2021-21291","license":"CVE Program Terms of Use","key":"cve-program:CVE-2021-21291","identifiers":["CVE-2021-21291"]},"retained":false,"historicalAffected":[]},{"revision":"efbccda45b414f079229021c3023fac8","observedAt":"2026-11-18T08:27:02.829+00:00","statement":{"source":"euvd","id":"EUVD-2021-0944","aliases":["CVE-2021-21291","GHSA-4mf2-f3wh-gvf2"],"title":"OAuth2 Proxy is an open-source reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others) to validate accounts by email, domain or group. In OAuth2 Proxy before version 7.0.0, for users th…","description":"OAuth2 Proxy is an open-source reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others) to validate accounts by email, domain or group. In OAuth2 Proxy before version 7.0.0, for users that use the whitelist domain feature, a domain that ended in a similar way to the intended domain could have been allowed as a redirect. For example, if a whitelist domain was configured for \".example.com\", the intention is that subdomains of example.com are allowed. Instead, \"example.com\" and \"badexample.com\" could also match. This is fixed in version 7.0.0 onwards. As a workaround, one can disable the whitelist domain feature and run separate OAuth2 Proxy instances for each subdomain.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"severity":null}],"references":["https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-4mf2-f3wh-gvf2","https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.0.0","https://pkg.go.dev/github.com/oauth2-proxy/oauth2-proxy/v7","https://github.com/oauth2-proxy/oauth2-proxy/commit/780ae4f3c99b579cb2ea9845121caebb6192f725"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2021-0944","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Feb 2, 2021, 7:05:18 PM","dateUpdated":"Aug 3, 2024, 6:09:15 PM"},"relatedAdvisories":[],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2021-0944","identifiers":["EUVD-2021-0944","CVE-2021-21291","GHSA-4mf2-f3wh-gvf2"]},"retained":false,"historicalAffected":[]},{"revision":"445b911172dc4f328a53e5f016418b26","observedAt":"2026-10-24T17:17:33.481+00:00","statement":{"source":"nvd","id":"CVE-2021-21291","aliases":[],"title":"OAuth2 Proxy is an open-source reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others) to validate accounts by email, domain or group. In OAuth2 Proxy before version 7.0.0, for users th…","description":"OAuth2 Proxy is an open-source reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others) to validate accounts by email, domain or group. In OAuth2 Proxy before version 7.0.0, for users that use the whitelist domain feature, a domain that ended in a similar way to the intended domain could have been allowed as a redirect. For example, if a whitelist domain was configured for \".example.com\", the intention is that subdomains of example.com are allowed. Instead, \"example.com\" and \"badexample.com\" could also match. This is fixed in version 7.0.0 onwards. As a workaround, one can disable the whitelist domain feature and run separate OAuth2 Proxy instances for each subdomain.","state":0,"publishedAt":"2021-02-02T19:15:14.33+00:00","modifiedAt":"2026-06-17T03:35:12.84+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N","score":4.7,"severity":"MEDIUM"},{"system":"CVSS 3.1 · nvd@nist.gov · Primary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"severity":"MEDIUM"},{"system":"CVSS 2.0 · nvd@nist.gov · Primary","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:N","score":5.8,"severity":"MEDIUM"}],"references":["https://github.com/oauth2-proxy/oauth2-proxy/commit/780ae4f3c99b579cb2ea9845121caebb6192f725","https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.0.0","https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-4mf2-f3wh-gvf2","https://pkg.go.dev/github.com/oauth2-proxy/oauth2-proxy/v7"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2021-21291","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Modified","weaknesses":["CWE-601"],"productCriteria":["cpe:2.3:a:oauth2_proxy_project:oauth2_proxy:*:*:*:*:*:*:*:*"],"sourceDates":{"published":"2021-02-02T19:15:14.330","lastModified":"2026-06-17T03:35:12.840"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2021-21291","identifiers":["CVE-2021-21291"]},"retained":false,"historicalAffected":[]},{"revision":"4c36baa02cab4fa0a765d1f46f409b58","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-4mf2-f3wh-gvf2","aliases":["BIT-oauth2-proxy-2021-21291","CVE-2021-21291","GO-2022-0790"],"title":"Subdomain checking of whitelisted domains could allow unintended redirects in oauth2-proxy","description":"### Impact\n_What kind of vulnerability is it? Who is impacted?_\nFor users that use the whitelist domain feature, a domain that ended in a similar way to the intended domain could have been allowed as a redirect.\n\nFor example, if a whitelist domain was configured for `.example.com`, the intention is that subdomains of `example.com` are allowed.\nInstead, `example.com` and `badexample.com` could also match.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\nThis is fixed in version 7.0.0 onwards.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\nDisable the whitelist domain feature and run separate OAuth2 Proxy instances for each subdomain.\n\n# Original Issue Posted by @semoac:\n\nWhitelist Domain feature is not working as expected because is not matching a dot to ensure the redirect is a subdomain.\n\n## Expected Behavior\n\nIf whitelist domain is set to `.example.com` , then `hack.alienexample.com`  should be rejected as a valid redirect.\n\n## Current Behavior\n\nThe code is removing the `dot`  from `.example.com`  and  only checking if the redirect string end with `example.com`\n\n## Possible Solution\nHere\nhttps://github.com/oauth2-proxy/oauth2-proxy/blob/c377466411f2aee180a732187edb638f2f7e57fb/oauthproxy.go#L661\n\nInclude the dot when checking the string:\n```\nstrings.HasSuffix(redirectHostname, \".\" + domainHostname)\n```\n\n## Steps to Reproduce (for bugs)\n\n```\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc validOptionalPort(port string) bool {\n\tif port == \"\" || port == \":*\" {\n\t\treturn true\n\t}\n\tif port[0] != ':' {\n\t\treturn false\n\t}\n\tfor _, b := range port[1:] {\n\t\tif b < '0' || b > '9' {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc splitHostPort(hostport string) (host, port string) {\n\thost = hostport\n\n\tcolon := strings.LastIndexByte(host, ':')\n\tif colon != -1 && validOptionalPort(host[colon:]) {\n\t\thost, port = host[:colon], host[colon+1:]\n\t}\n\n\tif strings.HasPrefix(host, \"[\") && strings.HasSuffix(host, \"]\") {\n\t\thost = host[1 : len(host)-1]\n\t}\n\n\treturn\n}\n\nfunc main() {\n\tdomain := \".example.com\"\n\tdomainHostname, _ := splitHostPort(strings.TrimLeft(domain, \".\"))\n\tredirectHostname := \"https://hack.alienexample.com\"\n\tif (strings.HasPrefix(domain, \".\") && strings.HasSuffix(redirectHostname, domainHostname)) { fmt.Println(\"This should not have happen.\")}\n}\n\n```\n\nUsers of `github.com/oauth2-proxy/oauth2-proxy` are advised to update to `github.com/oauth2-proxy/oauth2-proxy/v7`","state":0,"publishedAt":"2021-05-25T18:42:20+00:00","modifiedAt":"2026-09-10T03:49:04.3278481+00:00","affected":[{"ecosystem":"Go","name":"github.com/oauth2-proxy/oauth2-proxy/v7","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"7.0.0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"github.com/oauth2-proxy/oauth2-proxy","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"last_affected","version":"3.2.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"LOW"}],"references":["https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-4mf2-f3wh-gvf2","https://nvd.nist.gov/vuln/detail/CVE-2021-21291","https://github.com/oauth2-proxy/oauth2-proxy/commit/780ae4f3c99b579cb2ea9845121caebb6192f725","https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.0.0","https://pkg.go.dev/github.com/oauth2-proxy/oauth2-proxy/v7"],"sourceUrl":"https://github.com/advisories/GHSA-4mf2-f3wh-gvf2","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-4mf2-f3wh-gvf2","identifiers":["GHSA-4mf2-f3wh-gvf2","BIT-oauth2-proxy-2021-21291","CVE-2021-21291","GO-2022-0790"]},"retained":false,"historicalAffected":[]},{"revision":"136316575ea74648a11b03b0b5e85947","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2022-0790","aliases":["BIT-oauth2-proxy-2021-21291","CVE-2021-21291","GHSA-4mf2-f3wh-gvf2"],"title":"Subdomain checking of whitelisted domains could allow unintended redirects in oauth2-proxy in github.com/oauth2-proxy/oauth2-proxy","description":"Subdomain checking of whitelisted domains could allow unintended redirects in oauth2-proxy in github.com/oauth2-proxy/oauth2-proxy","state":0,"publishedAt":"2024-08-21T15:28:59+00:00","modifiedAt":"2026-03-03T04:50:53.714629+00:00","affected":[{"ecosystem":"Go","name":"github.com/oauth2-proxy/oauth2-proxy","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":[],"rawVersionEvidence":null},{"ecosystem":"Go","name":"github.com/oauth2-proxy/oauth2-proxy/v7","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"7.0.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-4mf2-f3wh-gvf2","https://nvd.nist.gov/vuln/detail/CVE-2021-21291","https://github.com/oauth2-proxy/oauth2-proxy/commit/780ae4f3c99b579cb2ea9845121caebb6192f725","https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.0.0","https://pkg.go.dev/github.com/oauth2-proxy/oauth2-proxy/v7"],"sourceUrl":"https://osv.dev/vulnerability/GO-2022-0790","license":"OSV · upstream source license applies","key":"osv:GO-2022-0790","identifiers":["GO-2022-0790","BIT-oauth2-proxy-2021-21291","CVE-2021-21291","GHSA-4mf2-f3wh-gvf2"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-19T06:24:22.7088152+00:00","complete":true,"records":1786,"lastAttemptAt":"2026-11-19T06:24:22.7088152+00:00","lastSuccessAt":"2026-11-19T06:24:22.8754391+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.8754399+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-e55c589538e0700b45c7d6d41fe1447a79199283262c371c864535c791a040b9-42f061bddbd482fb0fdcbfdaef32a6fe691ccebc959e217807f38a7ec448390c","complete":true,"records":428247,"lastAttemptAt":"2026-11-19T06:22:43.7183085+00:00","lastSuccessAt":"2026-11-19T06:22:43.6605476+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:22:43.7183085+00:00","snapshotPublishedAt":"2026-11-19T05:24:53+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-083dc80a6b0d4f35b068331bf39b5727","complete":false,"records":13861,"lastAttemptAt":"2026-11-19T06:32:59.6292222+00:00","lastSuccessAt":"2026-11-19T06:32:59.625+00:00","error":"208 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-19T06:32:59.625+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13581,"expectedIdentifiers":13908,"failedIdentifiers":208},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-19T06:24:22.7088152+00:00","complete":true,"records":1125,"lastAttemptAt":"2026-11-19T06:24:22.7088152+00:00","lastSuccessAt":"2026-11-19T06:24:22.8762559+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.8762561+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-84b4b212d7ef41cb9ec24b71e9d8e5d8","complete":true,"records":13873,"lastAttemptAt":"2026-11-19T06:24:23.3874789+00:00","lastSuccessAt":"2026-11-19T04:24:39.391+00:00","error":null,"lastVerifiedAt":"2026-11-19T04:24:39.391+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13908,"expectedIdentifiers":13908,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-76574c95b6792d47ba90af64983ed5843633f14426346d676016e94a5f383202","complete":true,"records":9963,"lastAttemptAt":"2026-11-19T06:24:22.665091+00:00","lastSuccessAt":"2026-11-19T01:24:31.4213722+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.665091+00:00","snapshotPublishedAt":"2026-11-19T01:03:15+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-f4424d7d4861b1af1404bd15abcb83f295dcd003412a9340ca99dc8200aa148a","complete":true,"records":2014,"lastAttemptAt":"2026-11-19T06:22:43.8470822+00:00","lastSuccessAt":"2026-11-13T19:57:08.2864435+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:22:43.8470822+00:00","snapshotPublishedAt":"2026-11-13T19:33:10+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-c0d9c71c6fa06d617f979e7bec0d97aca70ca5aea1558184002f8e44516f2fac","complete":true,"records":3177,"lastAttemptAt":"2026-11-19T06:24:22.6784424+00:00","lastSuccessAt":"2026-11-18T21:25:09.5127964+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.6784424+00:00","snapshotPublishedAt":"2026-11-18T21:18:06+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-79ba98249fc096fffe991a6a897ec91d79aa0bbce455566e233ea218d4eb3d8e","complete":true,"records":232711,"lastAttemptAt":"2026-11-19T06:24:22.5400107+00:00","lastSuccessAt":"2026-11-19T06:24:21.5299094+00:00","error":null,"lastVerifiedAt":"2026-11-19T06:24:22.5400107+00:00","snapshotPublishedAt":"2026-11-19T05:48:03+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}