Skip to content
Heist/ feed
Back to feed
Medium

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-21411

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-21411
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 08:48 UTC · Revision 1

Source evidence

CVE-2021-21411

core-osv · Original source

Published 26 Mar 2021, 21:15 UTC

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.

osv:CVE-2021-21411
Complete source record
{
  "id": "00794cb9ae663ab5acbb5503cc2e604650b99e4c5646e38109bfbc363324d884",
  "url": "https://osv.dev/vulnerability/CVE-2021-21411",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-21411",
    "summary": "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.",
    "evidence": "osv:CVE-2021-21411",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2021-21411",
      "aliases": [
        "BIT-oauth2-proxy-2021-21411",
        "CVE-2021-21411",
        "GHSA-652x-m2gr-hppm",
        "GO-2025-3832"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/oauth2-proxy/oauth2-proxy",
              "type": "GIT",
              "events": [
                {
                  "introduced": "06985879e19c3d47ed73ff650b67e2e775f88feb"
                },
                {
                  "fixed": "d64d717e630cd587000997db440579539ccc2e78"
                },
                {
                  "fixed": "0279fa7dff1752f1710707dbd1ffac839de8bbfc"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:oauth2_proxy_project:oauth2_proxy:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "7.0.0"
                      },
                      {
                        "fixed": "7.1.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "0279fa7dff1752f1710707dbd1ffac839de8bbfc"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "d64d717e630cd587000997db440579539ccc2e78"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v7.1.0"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v7.0.1",
            "v7.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21411.json"
          }
        }
      ],
      "modified": "2026-10-24T10:50:23.504935626Z",
      "provider": "osv",
      "references": [
        "https://docs.gitlab.com/ee/user/group/",
        "https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.1.0",
        "https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-652x-m2gr-hppm",
        "https://pkg.go.dev/github.com/oauth2-proxy/oauth2-proxy/v7",
        "https://github.com/oauth2-proxy/oauth2-proxy/commit/0279fa7dff1752f1710707dbd1ffac839de8bbfc"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:a:oauth2_proxy_project:oauth2_proxy:*:*:*:*:*:*:*:*"
            ],
            "vendor_product": "oauth2_proxy_project:oauth2_proxy",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "7.0.0"
                  },
                  {
                    "fixed": "7.1.0"
                  }
                ],
                "source": "CPE_RANGE"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2021-21411",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 442097,
  "published_at": "2021-03-26T21:15:13.63+00:00"
}