CVE-2024-2878

7.5 HIGH

📋 TL;DR

This vulnerability in GitLab CE/EE allows attackers to cause denial of service by crafting malicious search terms for branch names. The attack exploits inefficient search processing to consume excessive server resources. All GitLab instances running affected versions are vulnerable.

💻 Affected Systems

Products:
  • GitLab Community Edition
  • GitLab Enterprise Edition
Versions: 15.7 to 16.9.6, 16.10 to 16.10.4, 16.11 to 16.11.1
Operating Systems: All supported platforms
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments with branch search functionality enabled are vulnerable. No special configuration required.

📦 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 →

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 →

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

Complete service unavailability for all GitLab users due to resource exhaustion, potentially requiring manual intervention to restore service.

🟠

Likely Case

Temporary service degradation or partial unavailability affecting user productivity and CI/CD pipelines.

🟢

If Mitigated

Minimal impact with proper rate limiting, monitoring, and quick detection of anomalous search patterns.

🌐 Internet-Facing: HIGH - Publicly accessible GitLab instances are directly exposed to any internet user crafting malicious requests.
🏢 Internal Only: MEDIUM - Internal attackers or compromised accounts could still exploit this, but attack surface is reduced.

🎯 Exploit Status

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

Requires attacker to understand GitLab's search implementation and craft specific branch name patterns. Authentication may be required depending on project visibility settings.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 16.9.7, 16.10.5, or 16.11.2

Vendor Advisory: https://about.gitlab.com/releases/2024/05/08/patch-release-gitlab-16-11-2-released/

Restart Required: No

Instructions:

1. Backup your GitLab instance. 2. Update to patched version using your deployment method (Omnibus, Helm, source). 3. Verify upgrade completed successfully. 4. Monitor for any issues post-upgrade.

🔧 Temporary Workarounds

Rate Limit Branch Searches

all

Implement rate limiting on search endpoints to prevent resource exhaustion attacks

# Configure in GitLab application settings or via reverse proxy
# Example nginx rate limiting: limit_req_zone $binary_remote_addr zone=search:10m rate=10r/s;

Disable Branch Search

all

Temporarily disable branch search functionality if not critical

# Modify GitLab configuration to disable search features
# This is application-specific and may require code changes

🧯 If You Can't Patch

  • Implement strict rate limiting on all search endpoints
  • Monitor for unusual search patterns and block offending IPs

🔍 How to Verify

Check if Vulnerable:

Check GitLab version via admin panel or run: sudo gitlab-rake gitlab:env:info | grep 'GitLab version'

Check Version:

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

Verify Fix Applied:

Confirm version is 16.9.7, 16.10.5, 16.11.2 or higher. Test branch search functionality works normally.

📡 Detection & Monitoring

Log Indicators:

  • Unusually high CPU/memory usage during search operations
  • Multiple failed or slow search requests from single IP
  • Patterns of branch searches with special characters

Network Indicators:

  • Spike in HTTP requests to /api/v4/projects/*/repository/branches endpoint
  • Abnormal request patterns to search endpoints

SIEM Query:

source="gitlab.log" AND ("branch search" OR "/branches") AND (duration>5s OR status=500)

🔗 References

📤 Share & Export