# CVE-2021-21411: Incorrect authorization in OAuth2-Proxy

- Severity: Medium 5.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/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.07%, higher than 65% of CVEs (2026-12-01)
- Published: 2021-03-26T20:55:14.000Z
- Modified: 2026-09-08T08:48:10.761Z
- Also known as: GHSA-652x-m2gr-hppm, BIT-OAUTH2-PROXY-2021-21411, GO-2025-3832
- Weaknesses: CWE-285, CWE-863
- Assigned by: GitHub_M

## Description

OAuth2-Proxy is an open source reverse proxy that provides authentication with Google, Github or other providers. The `--gitlab-group` flag for group-based authorization in the GitLab provider stopped working in the v7.0.0 release. Regardless of the flag settings, authorization wasn't restricted. Additionally, any authenticated users had whichever groups were set in `--gitlab-group` added to the new `X-Forwarded-Groups` header to the upstream application. While adding GitLab project based authorization support in #630, a bug was introduced where the user session's groups field was populated with the `--gitlab-group` config entries instead of pulling the individual user's group membership from the GitLab Userinfo endpoint. When the session groups where compared against the allowed groups for authorization, they matched improperly (since both lists were populated with the same data) so authorization was allowed. This impacts GitLab Provider users who relies on group membership for authorization restrictions. Any authenticated users in your GitLab environment can access your applications regardless of `--gitlab-group` membership restrictions. This is patched in v7.1.0. There is no workaround for the Group membership bug. But `--gitlab-project` can be set to use Project membership as the authorization checks instead of groups; it is not broken.

(As written by CVE List.)

## Affected

- oauth2-proxy oauth2-proxy: >= 7.0.0, < 7.1.0
- github.com/oauth2-proxy/oauth2-proxy/v7 (Go): before 7.1.0
- github.com/oauth2-proxy/oauth2-proxy (Go): all versions
- oauth2_proxy_project oauth2_proxy: from 7.0.0 before 7.1.0
- oauth2-proxy (Bitnami): from 7.0.0 before 7.1.0

## Every score

- GitHub_M: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N`
- GitHub: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 5.5 Medium `AV:N/AC:L/Au:S/C:P/I:P/A:N`
- Bitnami Vulnerability Database: rating Medium

## References

- <https://pkg.go.dev/github.com/oauth2-proxy/oauth2-proxy/v7> (advisory, product, third-party-advisory, web)
- <https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-652x-m2gr-hppm> (advisory, third-party-advisory, web)
- <https://github.com/oauth2-proxy/oauth2-proxy/commit/0279fa7dff1752f1710707dbd1ffac839de8bbfc> (advisory, fix, patch, third-party-advisory, web)
- <https://docs.gitlab.com/ee/user/group/> (advisory, third-party-advisory)
- <https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.1.0> (advisory, release-notes, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-21411> (advisory, web)
- <https://docs.gitlab.com/ee/user/group> (web)
- <https://github.com/oauth2-proxy/oauth2-proxy> (package)

## Sources

- CVE List: [CVE-2021-21411](https://www.cve.org/CVERecord?id=CVE-2021-21411), CVE Terms of Use, modified 2024-08-03
- GitHub Advisory Database: [GHSA-652x-m2gr-hppm](https://github.com/advisories/GHSA-652x-m2gr-hppm), CC-BY-4.0, modified 2026-07-08
- Go Vulnerability Database: [GO-2025-3832](https://pkg.go.dev/vuln/GO-2025-3832), CC-BY-4.0, modified 2026-03-03
- NVD: [CVE-2021-21411](https://nvd.nist.gov/vuln/detail/CVE-2021-21411), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-OAUTH2-PROXY-2021-21411](https://osv.dev/vulnerability/BIT-OAUTH2-PROXY-2021-21411), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2021-21411 · Whole record: https://cve.day/CVE-2021-21411.json · Rebuilt by cve.day 2026-11-25T22:58:00.472Z
