# CVE-2021-21291: Subdomain checking of whitelisted domains could allow unintended redirects

- Severity: Medium 4.7 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.59%, higher than 76% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2021-02-02T19:05:18.000Z
- Modified: 2026-09-10T03:49:04.327Z
- Also known as: GHSA-4mf2-f3wh-gvf2, BIT-OAUTH2-PROXY-2021-21291, GO-2022-0790
- Weaknesses: CWE-601
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- oauth2-proxy oauth2-proxy: < 7.0.0
- github.com/oauth2-proxy/oauth2-proxy/v7 (Go): before 7.0.0
- github.com/oauth2-proxy/oauth2-proxy (Go): up to 3.2.0; all versions
- oauth2_proxy_project oauth2_proxy: before 7.0.0
- oauth2-proxy (Bitnami): before 7.0.0

## Every score

- GitHub_M: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 5.4 Low `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N`
- NVD: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 5.8 Medium `AV:N/AC:M/Au:N/C:P/I:P/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-4mf2-f3wh-gvf2> (exploit, advisory, third-party-advisory, web)
- <https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.0.0> (advisory, release-notes, third-party-advisory, web)
- <https://pkg.go.dev/github.com/oauth2-proxy/oauth2-proxy/v7> (advisory, product, third-party-advisory, web)
- <https://github.com/oauth2-proxy/oauth2-proxy/commit/780ae4f3c99b579cb2ea9845121caebb6192f725> (advisory, fix, patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21291> (advisory, web)

## Sources

- CVE List: [CVE-2021-21291](https://www.cve.org/CVERecord?id=CVE-2021-21291), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-4mf2-f3wh-gvf2](https://github.com/advisories/GHSA-4mf2-f3wh-gvf2), CC-BY-4.0, modified 2026-09-10
- Go Vulnerability Database: [GO-2022-0790](https://pkg.go.dev/vuln/GO-2022-0790), CC-BY-4.0, modified 2026-03-03
- NVD: [CVE-2021-21291](https://nvd.nist.gov/vuln/detail/CVE-2021-21291), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-OAUTH2-PROXY-2021-21291](https://osv.dev/vulnerability/BIT-OAUTH2-PROXY-2021-21291), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-21291 · Whole record: https://cve.day/CVE-2021-21291.json · Rebuilt by cve.day 2026-11-25T22:57:59.776Z
