GitLabApplication

CVE-2021-39941

MEDIUM · 5.3 CVSS v3.1 Published 2021-12-13
Fix available
A fix is available. Upgrade to 14.3.6 / 14.4.4 or later.
See remediation →
62/100
Remediation priority · Elevated
Remotely reachable No privileges Zero-click

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 · unedited
An information disclosure vulnerability in GitLab CE/EE versions 12.0 to 14.3.6, 14.4 to 14.4.4, and 14.5 to 14.5.2 allowed non-project members to see the default branch name for projects that restrict access to the repository to project members

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 confidence

In affected GitLab versions, the default branch name was disclosed to non-project members even when project repository access was restricted to members only. This occurred because the system exposed the default branch name in certain API responses or UI elements accessible to unauthenticated or non-member users.

MitigationUpgrade GitLab to version 14.3.7, 14.4.5, or 14.5.3 or later. Alternatively, ensure repository access restrictions are properly configured and consider network-level access controls until patching is feasible.

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
GitLabApplication
Affected:>= 12.0.0, < 14.3.6>= 14.4.0, < 14.4.4>= 14.5.0, < 14.5.2

CVSS 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 checks

Work through these to decide whether this CVE applies to you.

  1. Identify installed GitLab version
    Run `sudo gitlab-rake gitlab:env:info` or check the GitLab admin panel under Admin Area > Overview > Dashboard. Alternatively, check the version file at `/opt/gitlab/version` or via API: `curl -s https://gitlab-instance/api/v4/version`
    Affected if The installed version falls within: >= 12.0.0 and < 14.3.6, OR >= 14.4.0 and < 14.4.4, OR >= 14.5.0 and < 14.5.2
  2. Verify project repository access restrictions exist
    Navigate to Project Settings > Repository > Expand > Protected branches or check Project > Settings > Members to confirm projects have restricted access requiring membership for repository visibility
    Affected if Projects have repository access restricted to team members only (not public or internal)
  3. Test API response for default branch disclosure
    As an unauthenticated user or non-member user, query the project API endpoint: `curl -s https://gitlab-instance/api/v4/projects/<project-id>` or attempt to access `https://gitlab-instance/<project-path>` while logged out. Inspect the JSON response for the 'default_branch' field or check UI for branch information
    Affected if The default branch name is visible in the API response or UI to users who are not project members
  4. Check project metadata API endpoints
    Query the GitLab GraphQL API or project summary endpoint as a non-member: `curl -s https://gitlab-instance/api/v4/projects/<project-id>` should not expose branch details to non-members. Also check `GET /projects/:id` with minimal authentication
    Affected if Default branch name appears in any project metadata accessible to non-members

You are affected if your GitLab version is within the affected ranges AND you have projects with repository access restricted to members, where the default branch name is visible in API responses or UI to non-members.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Upgrade available Upgrade to 14.3.6 / 14.4.4 / 14.5.2 or later
Fixed in 14.3.614.4.414.5.2
Interim mitigation

Upgrade GitLab to version 14.3.7, 14.4.5, or 14.5.3 or later. Alternatively, ensure repository access restrictions are properly configured and consider network-level access controls until patching is feasible.

Recommended fix High confidence

GitLab 14.3.6 (for 12.0-14.3.x), 14.4.4 (for 14.4.x), or 14.5.2 (for 14.5.x) - or latest stable 14.x release

  1. 1. Identify your current GitLab version by navigating to the GitLab admin area or checking the /help/version endpoint
  2. 2. Determine which version range your current installation falls into: 12.0.0-14.3.5, 14.4.0-14.4.3, or 14.5.0-14.5.1
  3. 3. For versions 12.0.0-14.3.5: upgrade to GitLab 14.3.6 or later (preferably 14.3.6)
  4. 4. For versions 14.4.0-14.4.3: upgrade to GitLab 14.4.4 or later (preferably 14.4.4)
  5. 5. For versions 14.5.0-14.5.1: upgrade to GitLab 14.5.2 or later (preferably 14.5.2)
  6. 6. Follow the official GitLab upgrade documentation for your installation method (omnibus, source, or helm chart)
  7. 7. After upgrade, verify the version at /help/version
  8. 8. Confirm the vulnerability is remediated by verifying that non-project members can no longer see default branch names for restricted projects
Caveat GitLab major version upgrades (e.g., 12.x to 14.x) require careful migration planning; review release notes for database migrations and breaking changes

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in GitLab Scoped from the published advisory
  • Consultation1.0 h
  • Implementation2.0 h
  • Testing2.0 h
  • Review / QA1.0 h
6.0 hours of engineering $1,040
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,664.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2021-39941 — 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2021-39941 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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