CVE-2025-9222

8.7 HIGH

📋 TL;DR

This vulnerability allows an authenticated user to inject malicious scripts into GitLab's Markdown rendering, which then executes in other users' browsers when they view the content. It affects all GitLab Community Edition and Enterprise Edition installations running vulnerable versions. Attackers could steal session cookies, redirect users, or perform actions on their behalf.

💻 Affected Systems

Products:
  • GitLab Community Edition
  • GitLab Enterprise Edition
Versions: 18.2.2 to 18.5.4, 18.6.0 to 18.6.2, 18.7.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: All deployments using vulnerable versions are affected regardless of configuration. Requires authenticated user access.

📦 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 tokens, take over accounts, exfiltrate sensitive data, or deploy ransomware across the GitLab instance.

🟠

Likely Case

Attackers inject malicious JavaScript into issues, merge requests, or comments to steal session cookies from other users, leading to account compromise.

🟢

If Mitigated

With proper CSP headers and other web security controls, script execution might be blocked, limiting impact to UI manipulation or data leakage.

🌐 Internet-Facing: HIGH
🏢 Internal Only: HIGH

🎯 Exploit Status

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

Exploitation requires authenticated access but is straightforward once an account is obtained. Markdown injection is a well-known attack vector.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 18.5.5, 18.6.3, or 18.7.1

Vendor Advisory: https://about.gitlab.com/releases/2026/01/07/patch-release-gitlab-18-7-1-released/

Restart Required: Yes

Instructions:

1. Backup your GitLab instance. 2. Update to GitLab 18.5.5, 18.6.3, or 18.7.1 using your package manager. 3. Run 'sudo gitlab-ctl reconfigure'. 4. Run 'sudo gitlab-ctl restart'.

🔧 Temporary Workarounds

Disable Markdown rendering for untrusted users

all

Restrict Markdown editing permissions to trusted users only through project settings.

Implement Content Security Policy

linux

Add CSP headers to block inline script execution in GitLab responses.

Add to nginx config: add_header Content-Security-Policy "script-src 'self';" always;

🧯 If You Can't Patch

  • Restrict user registration and require manual approval for new accounts.
  • Monitor GitLab logs for unusual Markdown patterns and implement WAF rules to block script tags in user content.

🔍 How to Verify

Check if Vulnerable:

Check your GitLab version: if it's between 18.2.2-18.5.4, 18.6.0-18.6.2, or exactly 18.7.0, you are vulnerable.

Check Version:

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

Verify Fix Applied:

After patching, verify version is 18.5.5, 18.6.3, or 18.7.1 or higher.

📡 Detection & Monitoring

Log Indicators:

  • Unusual Markdown content in GitLab logs containing script tags or JavaScript
  • Multiple failed login attempts followed by successful login and Markdown posting

Network Indicators:

  • Outbound connections to unknown domains from GitLab server after Markdown rendering
  • Unexpected JavaScript execution in browser dev tools

SIEM Query:

source="gitlab" AND ("script" OR "javascript" OR "onclick") IN message

🔗 References

📤 Share & Export