CVE-2023-3364

7.5 HIGH

📋 TL;DR

This vulnerability allows attackers to cause denial of service (DoS) in GitLab by sending specially crafted payloads to the preview_markdown endpoint. The issue affects GitLab Community Edition and Enterprise Edition installations running vulnerable versions. Attackers can exploit a regular expression processing flaw in the AutolinkFilter to consume excessive server resources.

💻 Affected Systems

Products:
  • GitLab Community Edition
  • GitLab Enterprise Edition
Versions: All versions from 8.14 before 16.0.8, all versions from 16.1 before 16.1.3, all versions from 16.2 before 16.2.2
Operating Systems: All supported platforms
Default Config Vulnerable: ⚠️ Yes
Notes: Affects all deployments with the vulnerable GitLab versions regardless of configuration.

📦 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 due to resource exhaustion, potentially affecting all GitLab services including repositories, CI/CD pipelines, and user management.

🟠

Likely Case

Degraded performance or temporary service disruption affecting markdown preview functionality and potentially other services sharing resources.

🟢

If Mitigated

Minimal impact with proper rate limiting, WAF rules, and network segmentation in place.

🌐 Internet-Facing: HIGH - The preview_markdown endpoint is typically accessible to authenticated users and potentially to unauthenticated users depending on configuration.
🏢 Internal Only: MEDIUM - Internal attackers or compromised accounts could still exploit this to disrupt services.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires sending crafted payloads to the preview_markdown endpoint. Authentication is typically required but may vary by configuration.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 16.0.8, 16.1.3, or 16.2.2

Vendor Advisory: https://about.gitlab.com/releases/2023/07/05/critical-security-release-gitlab-16-2-2-released/

Restart Required: Yes

Instructions:

1. Backup your GitLab instance. 2. Update to GitLab 16.0.8, 16.1.3, or 16.2.2 depending on your current version. 3. Restart GitLab services. 4. Verify the update was successful.

🔧 Temporary Workarounds

Rate Limiting

all

Implement rate limiting on the preview_markdown endpoint to prevent excessive requests.

Configure in GitLab application settings or via reverse proxy (nginx/apache) rules

WAF Rules

all

Add Web Application Firewall rules to block suspicious regex patterns in markdown preview requests.

Add custom WAF rules to detect and block ReDoS patterns

🧯 If You Can't Patch

  • Restrict access to the preview_markdown endpoint using network ACLs or authentication requirements
  • Monitor server resource usage and implement alerting for abnormal CPU/memory consumption patterns

🔍 How to Verify

Check if Vulnerable:

Check GitLab version via admin interface or command line. If version is between 8.14-16.0.7, 16.1.0-16.1.2, or 16.2.0-16.2.1, the system is vulnerable.

Check Version:

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

Verify Fix Applied:

Confirm GitLab version is 16.0.8, 16.1.3, 16.2.2 or higher. Test markdown preview functionality works normally.

📡 Detection & Monitoring

Log Indicators:

  • High CPU usage patterns
  • Multiple requests to /api/v4/markdown endpoint
  • Slow response times for markdown preview

Network Indicators:

  • Unusual volume of POST requests to markdown preview endpoints
  • Requests with complex regex patterns in payload

SIEM Query:

source="gitlab" AND (uri_path="/api/v4/markdown" OR uri_path CONTAINS "preview_markdown") AND status>=500

🔗 References

📤 Share & Export