CVE-2021-21411: Github.com/oauth2 proxy/oauth2 proxy/v7 OAuth2-Proxy's `--gitlab-group` GitLab Group Authorization Vulnerability
MODERATECVE-2021-21411 is a MODERATE (CVSS 5.5) oauth2-proxy's `--gitlab-group` gitlab group authorization vulnerability (CWE-285: Improper Authorization) affecting Github.com/oauth2 proxy/oauth2 proxy/v7 libraries in the Go ecosystem. The issue involves oauth2-proxy's `--gitlab-group` gitlab group authorization config flag stopped working in v7.0.0. Remediation is available by upgrading affected packages to version 7.1.0.
CVE-2021-21411 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N).
How to Fix CVE-2021-21411
To remediate this vulnerability, upgrade all affected Github.com/oauth2 proxy/oauth2 proxy/v7 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/oauth2-proxy/oauth2-proxy/v7 to 7.1.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/oauth2-proxy/oauth2-proxy/v7
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-21411, inspect your project dependencies for Github.com/oauth2 proxy/oauth2 proxy/v7:
inspect dependencies for github.com/oauth2-proxy/oauth2-proxy/v7
Analyze the terminal output to locate any version of Github.com/oauth2 proxy/oauth2 proxy/v7 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.1.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Github.com/oauth2 proxy/oauth2 proxy/v7, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-21411 Affected Github.com/oauth2 proxy/oauth2 proxy/v7 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/oauth2-proxy/oauth2-proxy/v7
|
Go |
< 7.1.0
|
7.1.0
|
References
Frequently Asked Questions
What is CVE-2021-21411?
Which Github.com/oauth2 proxy/oauth2 proxy/v7 versions are affected?
What version fixes CVE-2021-21411?
Is github.com/oauth2-proxy/oauth2-proxy/v7 affected?
What is the CVSS score of CVE-2021-21411?
What CWE is associated with CVE-2021-21411?
How can I check Go dependencies for CVE-2021-21411?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-652x-m2gr-hppm",
"modified" : "2025-07-30T16:21:04Z",
"published" : "2025-07-30T16:21:04Z",
"aliases" : [ "CVE-2021-21411" ],
"summary" : "OAuth2-Proxy's `--gitlab-group` GitLab Group Authorization config flag stopped working in v7.0.0",
"details" : "The `--gitlab-group` flag for group-based authorization in the GitLab provider stopped working in the v7.0.0 release.\n\nRegardless 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.\n\nWhile 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.\n\n### Impact\nThis 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.\n\n### Patches\nThis is patched in v7.1.0\n\n### Workarounds\nThere 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/oauth2-proxy/oauth2-proxy/v7"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "7.1.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/oauth2-proxy/oauth2-proxy/security/advisories/GHSA-652x-m2gr-hppm"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-21411"
}, {
"type" : "WEB",
"url" : "https://github.com/oauth2-proxy/oauth2-proxy/commit/0279fa7dff1752f1710707dbd1ffac839de8bbfc"
}, {
"type" : "WEB",
"url" : "https://docs.gitlab.com/ee/user/group"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/oauth2-proxy/oauth2-proxy"
}, {
"type" : "WEB",
"url" : "https://github.com/oauth2-proxy/oauth2-proxy/releases/tag/v7.1.0"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/github.com/oauth2-proxy/oauth2-proxy/v7"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-285", "CWE-863" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-07-30T16:21:04Z",
"nvd_published_at" : null
}
}