CVE-2025-4700

8.7 HIGH

📋 TL;DR

This vulnerability in GitLab allows attackers to inject malicious scripts that execute in users' browsers when viewing specially crafted content, leading to cross-site scripting (XSS). All GitLab CE/EE instances running affected versions are vulnerable. Attackers could steal session cookies, redirect users, or perform actions on their behalf.

💻 Affected Systems

Products:
  • GitLab Community Edition
  • GitLab Enterprise Edition
Versions: 15.10 to 18.0.4, 18.1 to 18.1.2, 18.2 to 18.2.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments with affected versions are vulnerable 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

An attacker could steal administrator session cookies, gain full control of the GitLab instance, access source code, modify repositories, and pivot to internal systems.

🟠

Likely Case

Attackers steal user session cookies to access private repositories, modify code, or perform unauthorized actions under the victim's identity.

🟢

If Mitigated

With proper input validation and output encoding, the attack would fail to execute malicious scripts, limiting impact to failed exploitation attempts.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires specific circumstances and user interaction with malicious content.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 18.0.5, 18.1.3, or 18.2.1

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

Restart Required: Yes

Instructions:

1. Backup your GitLab instance. 2. Update to GitLab 18.0.5, 18.1.3, or 18.2.1 using your package manager. 3. Restart GitLab services. 4. Verify the update was successful.

🔧 Temporary Workarounds

Content Security Policy (CSP)

all

Implement a strict CSP to block inline scripts and restrict script sources.

Add CSP headers via web server configuration or GitLab settings

Input Sanitization

all

Enable strict input validation and output encoding for user-generated content.

Configure GitLab to sanitize all user inputs and encode outputs

🧯 If You Can't Patch

  • Restrict access to GitLab instance using network ACLs or firewall rules
  • Implement web application firewall (WAF) with XSS protection rules

🔍 How to Verify

Check if Vulnerable:

Check GitLab version via Admin Area or command: sudo gitlab-rake gitlab:env:info

Check Version:

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

Verify Fix Applied:

Confirm version is 18.0.5, 18.1.3, or 18.2.1 or higher

📡 Detection & Monitoring

Log Indicators:

  • Unusual POST requests with script tags
  • Multiple failed content rendering attempts
  • Suspicious user agent strings

Network Indicators:

  • HTTP requests containing malicious script payloads
  • Unexpected redirects to external domains

SIEM Query:

source="gitlab" AND (http_method="POST" AND uri_path="/*" AND (content="<script>" OR content="javascript:"))

🔗 References

📤 Share & Export