CVE-2021-22257
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedAn issue has been discovered in GitLab affecting all versions starting from 14.0 before 14.0.9, all versions starting from 14.1 before 14.1.4, all versions starting from 14.2 before 14.2.2. The route for /user.keys is not restricted on instances with public visibility disabled. This allows user enumeration on such instances.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceGitLab versions 14.0.x before 14.0.9, 14.1.x before 14.1.4, and 14.2.x before 14.2.2 have an improper access control vulnerability where the /user.keys endpoint remains accessible even when public visibility is disabled on the instance. This allows unauthenticated attackers to enumerate valid usernames by querying this endpoint and receiving different responses for existing versus non-existing users.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data>= 14.0.0, < 14.0.9>= 14.1.0, < 14.1.4>= 14.2.0, < 14.2.2CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- Low
- Integrity
- None
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Determine installed GitLab versionRun 'gitlab-rake gitlab:env:info' or check /opt/gitlab/version to find the exact GitLab version installedAffected if Version is 14.0.0-14.0.8, 14.1.0-14.1.3, or 14.2.0-14.2.1
-
Check public visibility settingsNavigate to Admin Area > Settings > Visibility and Controls > General > Visibility and access controls, or inspect gitlab.yml configuration for 'default_projects_limit' or 'restricted_visibility_levels' settingsAffected if Public visibility is disabled but /user.keys remains accessible
-
Test unauthenticated access to /user.keysSend a GET request to https://YOUR_GITLAB_URL/user.keys without authentication (no login token)Affected if Endpoint returns HTTP 200 with key data or different response for existing vs non-existing usernames (valid usernames return specific response, non-existing return 404 or empty)
-
Verify username enumeration is possibleCompare responses from /user.keys?username=VALID_USER vs /user.keys?username=NONEXISTENT_USER - look for differences in HTTP status code or response bodyAffected if Different responses are returned allowing attacker to confirm valid usernames without authentication
You are affected if GitLab version is 14.0.x < 14.0.9, 14.1.x < 14.1.4, or 14.2.x < 14.2.2 AND the /user.keys endpoint responds to unauthenticated requests with username-dependent responses.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scoped14.0.914.1.414.2.2
Upgrade GitLab to version 14.0.9, 14.1.4, or 14.2.2 or later. Alternatively, configure web application firewall rules to restrict unauthenticated access to the /user.keys endpoint until upgrade can be performed.
Upgrade to GitLab 14.0.9, 14.1.4, or 14.2.2 (or later stable release)
- Identify your current GitLab version by checking the GitLab administration panel or running `gitlab-rake gitlab:env:info`
- Determine which version branch you are on (14.0.x, 14.1.x, or 14.2.x)
- Upgrade GitLab to the appropriate fixed version: 14.0.9, 14.1.4, or 14.2.2
- For Omnibus installations: Run `sudo gitlab-ctl restart` after upgrade
- For source installations: Restart the GitLab service after upgrade
- Verify the upgrade was successful and the /user.keys route is now restricted
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation2.0 h
- Implementation1.0 h
- Testing2.0 h
- Review / QA1.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,696.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2021-22257 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2021-22257 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data