CVE-2025-4097

6.5 MEDIUM

📋 TL;DR

This vulnerability in GitLab allows authenticated users to upload specially crafted images that cause a denial of service condition. It affects GitLab Community Edition and Enterprise Edition installations running vulnerable versions. The attack requires authentication but could disrupt GitLab service availability.

💻 Affected Systems

Products:
  • GitLab Community Edition
  • GitLab Enterprise Edition
Versions: All versions from 11.10 before 18.4.6, 18.5 before 18.5.4, and 18.6 before 18.6.2
Operating Systems: All operating systems running GitLab
Default Config Vulnerable: ⚠️ Yes
Notes: All standard GitLab installations with image upload 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 of GitLab instance, disrupting all Git operations, CI/CD pipelines, and collaboration features for all users.

🟠

Likely Case

Temporary service degradation or crashes affecting some users, requiring administrator intervention to restart services.

🟢

If Mitigated

Minimal impact with proper image upload restrictions and monitoring in place, allowing quick detection and response.

🌐 Internet-Facing: HIGH - Internet-facing GitLab instances are directly accessible to attackers who can obtain or already have valid credentials.
🏢 Internal Only: MEDIUM - Internal instances are still vulnerable but require attacker to have internal network access and valid credentials.

🎯 Exploit Status

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

Exploitation requires authenticated access but appears straightforward based on the CWE-770 (Allocation of Resources Without Limits or Throttling) classification.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 18.4.6, 18.5.4, or 18.6.2

Vendor Advisory: https://about.gitlab.com/releases/2025/12/10/patch-release-gitlab-18-6-2-released/

Restart Required: Yes

Instructions:

1. Backup your GitLab instance. 2. Update to GitLab 18.4.6, 18.5.4, or 18.6.2 depending on your current version track. 3. Restart GitLab services. 4. Verify the update was successful.

🔧 Temporary Workarounds

Restrict image uploads

all

Disable or restrict image upload functionality for non-administrative users

# Configure in GitLab admin settings or via application configuration

Implement rate limiting

all

Add rate limiting on image upload endpoints to prevent resource exhaustion

# Configure via web server (nginx/apache) or application-level rate limiting

🧯 If You Can't Patch

  • Implement strict access controls and monitor for suspicious image upload activity
  • Deploy WAF rules to block malicious image upload patterns and implement resource limits

🔍 How to Verify

Check if Vulnerable:

Check GitLab version via admin interface or by running: sudo gitlab-rake gitlab:env:info

Check Version:

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

Verify Fix Applied:

Confirm version is 18.4.6, 18.5.4, or 18.6.2 or higher, and test image upload functionality

📡 Detection & Monitoring

Log Indicators:

  • Multiple failed image upload attempts
  • Unusually large image uploads
  • Service restart logs following image uploads

Network Indicators:

  • Spike in POST requests to image upload endpoints
  • Large file uploads to GitLab image endpoints

SIEM Query:

source="gitlab" AND ("image upload" OR "POST /uploads") AND size>10000000

🔗 References

📤 Share & Export