CVE-2023-3441

6.6 MEDIUM

📋 TL;DR

This vulnerability in GitLab EE/CE allows users with merge rights to protected branches to potentially bypass security controls and push malicious code. It affects all GitLab instances from version 8.0 through 16.3. The issue stems from insufficient warnings about the security implications of granting merge permissions.

💻 Affected Systems

Products:
  • GitLab Community Edition
  • GitLab Enterprise Edition
Versions: 8.0 through 16.3
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all deployments where protected branches exist and users have merge permissions.

📦 What is this software?

Gitlab by Gitlab

GitLab is a complete DevOps platform providing source code management, CI/CD pipelines, security scanning, container registry, and collaboration tools used by millions of developers and thousands of enterprises worldwide. As both a cloud-hosted SaaS offering (GitLab.com) and self-managed software, G...

Learn more about Gitlab →

Gitlab by Gitlab

GitLab is a complete DevOps platform providing source code management, CI/CD pipelines, security scanning, container registry, and collaboration tools used by millions of developers and thousands of enterprises worldwide. As both a cloud-hosted SaaS offering (GitLab.com) and self-managed software, G...

Learn more about Gitlab →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers with merge rights could inject malicious code into protected branches, potentially compromising the entire codebase and downstream deployments.

🟠

Likely Case

Accidental or intentional misuse of merge permissions leading to unauthorized code changes in protected branches.

🟢

If Mitigated

Minimal impact with proper branch protection policies and limited merge permissions to trusted users only.

🌐 Internet-Facing: MEDIUM
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Requires authenticated user with merge permissions to protected branches.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 16.4.0 and later

Vendor Advisory: https://gitlab.com/gitlab-org/gitlab/-/issues/416482

Restart Required: Yes

Instructions:

1. Backup your GitLab instance. 2. Update GitLab to version 16.4.0 or later. 3. Restart GitLab services. 4. Verify the update was successful.

🔧 Temporary Workarounds

Restrict Merge Permissions

all

Limit merge permissions to protected branches to only essential, trusted users.

Implement Code Review Requirements

all

Require mandatory code reviews and approvals before merging to protected branches.

🧯 If You Can't Patch

  • Audit all users with merge permissions to protected branches and remove unnecessary access.
  • Implement additional monitoring and alerting for merges to protected branches.

🔍 How to Verify

Check if Vulnerable:

Check GitLab version via admin panel or command line. If version is between 8.0 and 16.3, the instance is vulnerable.

Check Version:

sudo gitlab-rake gitlab:env:info | grep 'GitLab version'

Verify Fix Applied:

After updating to 16.4.0 or later, verify the version and check that merge permission warnings are now properly displayed.

📡 Detection & Monitoring

Log Indicators:

  • Unusual merge activity to protected branches
  • Merge requests from unexpected users

Network Indicators:

  • Increased API calls to merge endpoints

SIEM Query:

source="gitlab" AND (event="merge" OR event="push") AND branch="protected_*"

🔗 References

📤 Share & Export