5.5medium
Incorrect authorization in OAuth2-Proxy
- Severity
- 5.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.07% (higher than 65% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-652x-m2gr-hppmBIT-OAUTH2-PROXY-2021-21411GO-2025-3832
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| oauth2-proxy oauth2-proxy | >= 7.0.0, < 7.1.0 | CVE List |
| github.com/oauth2-proxy/oauth2-proxy/v7 (Go) | before 7.1.0 | GitHub Advisory Database, Go Vulnerability Database |
| github.com/oauth2-proxy/oauth2-proxy (Go) | all versions | Go Vulnerability Database |
| oauth2_proxy_project oauth2_proxy | from 7.0.0 before 7.1.0 | NVD |
| oauth2-proxy (Bitnami) | from 7.0.0 before 7.1.0 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 5.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N |
| GitHub | 5.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N |
| NVD | 5.5medium CVSS:2.0 | AV:N/AC:L/Au:S/C:P/I:P/A:N |
| Bitnami Vulnerability Database | medium rating |
Classification
What each source says
CVE List
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.
GitHub Advisory Database
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.
Impact
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.
Patches
This is patched in v7.1.0
Workarounds
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.
Go Vulnerability Database
OAuth2-Proxy's --gitlab-group GitLab Group Authorization config flag stopped working in v7.0.0 in github.com/oauth2-proxy/oauth2-proxy
NVD (es)
OAuth2-Proxy es un proxy inverso de código abierto que proporciona autenticación con Google, Github u otros proveedores. El flag "--gitlab-group" para la autorización basada en grupos en el proveedor GitLab dejó de funcionar en la versión v7.0.0. Independientemente de la configuración del flag, la autorización no estaba restringida. Además, cualquier usuario autenticado tenía los grupos que habían sido establecidos en "--gitlab-group" añadidos al nuevo encabezado "X-Forwarded-Groups" para la aplicación de origen. Al añadir la compatibilidad con la autorización basada en proyectos de GitLab en el número 630, se introdujo un error por el que el campo groups de la sesión del usuario se rellenaba con las entradas de configuración de "--gitlab-group" en lugar de extraer la pertenencia al grupo del usuario individual desde el endpoint de GitLab Userinfo. Cuando los grupos de la sesión se comparaban con los grupos permitidos para la autorización, coincidían incorrectamente (ya que ambas listas se rellenaban con los mismos datos), por lo que se permitía la autorización. Esto afecta a usuarios del proveedor de GitLab que se basan en la pertenencia a grupos para las restricciones de autorización. Cualquier usuario autenticado en su entorno de GitLab puede acceder a sus aplicaciones independientemente de las restricciones de pertenencia a grupos de "--gitlab-group". Esto ha sido corregido en la versión 7.1.0. No se presenta una solución para el error de Group membership. Pero "--gitlab-project" puede ser configurado para usar Project membership como la comprobación de la autorización en lugar de los grupos; esto no está roto.
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-21411 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-652x-m2gr-hppm changed 2026-07-08 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2025-3832 changed 2026-03-03 | CC-BY-4.0 |
| NVD | CVE-2021-21411 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-OAUTH2-PROXY-2021-21411 changed 2026-09-08 | Apache-2.0 |