Skip to main content

CVE-2025-6186: GitLab Account Takeover XSS Vulnerability

CVE-2025-6186 is a cross-site scripting vulnerability in GitLab CE/EE that enables authenticated users to achieve account takeover by injecting malicious HTML into work item names. This article covers technical details, affected versions, impact assessment, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-6186 Overview

CVE-2025-6186 is a stored cross-site scripting (XSS) vulnerability in GitLab Community Edition (CE) and Enterprise Edition (EE). The flaw affects all versions from 18.1 before 18.1.4 and 18.2 before 18.2.2. Authenticated users can inject malicious HTML into work item names. When another user views the affected work item, the injected payload executes in their browser context. Successful exploitation can lead to account takeover of the victim user. The issue is tracked under CWE-79: Improper Neutralization of Input During Web Page Generation.

Critical Impact

Authenticated attackers can inject HTML into work item names to hijack sessions of other GitLab users who view the content, resulting in account takeover.

Affected Products

  • GitLab Community Edition (CE) versions 18.1 before 18.1.4
  • GitLab Community Edition (CE) and Enterprise Edition (EE) versions 18.2 before 18.2.2
  • GitLab Enterprise Edition (EE) versions 18.1 before 18.1.4

Discovery Timeline

  • 2025-08-13 - CVE-2025-6186 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-6186

Vulnerability Analysis

The vulnerability is a stored XSS flaw located in the work item feature of GitLab CE/EE. Work items are a unified data model GitLab uses to represent issues, tasks, epics, and similar objects. The name field of a work item does not properly neutralize HTML markup supplied by an authenticated user. When the stored name is later rendered to another user, the browser interprets the embedded markup as part of the page.

Because the payload persists server-side, exploitation does not require social engineering a one-time link. Any user who navigates to a project view that lists the affected work item triggers execution. The attack chain requires authentication to create or modify work items and user interaction from the victim to load the view. Impact spans integrity and confidentiality of the victim's session, including the possibility of account takeover via session or token theft.

Root Cause

The root cause is improper neutralization of input during web page generation [CWE-79]. User-controlled strings supplied as the work item name are rendered without sufficient encoding or sanitization in at least one view context. The HackerOne submission (HackerOne Report #3189522) and the upstream tracking ticket (GitLab Issue #549844) describe the behavior under a scoped change in authority, meaning the executed script can act against resources outside the attacker's own privileges.

Attack Vector

An authenticated attacker with permission to create or edit work items in a project supplies a crafted name containing HTML or script content. GitLab stores the value. When a victim user with greater or different privileges views the work item or a page that renders the name, the payload executes in their browser session. The attacker can then perform actions as the victim, exfiltrate session tokens, or trigger GitLab API calls using the victim's credentials. No code example is published by the vendor; refer to the vendor advisory and HackerOne report for technical specifics.

Detection Methods for CVE-2025-6186

Indicators of Compromise

  • Work item names containing HTML tags, <script> fragments, event handler attributes such as onerror= or onload=, or javascript: URIs
  • Unexpected outbound requests from browser sessions of GitLab users to attacker-controlled domains shortly after viewing a work item
  • GitLab audit log entries showing work item name updates from low-privilege users followed by suspicious API calls from higher-privilege accounts

Detection Strategies

  • Query the GitLab database or REST API for work item titles matching HTML tag patterns and review authors and timestamps
  • Enable and review GitLab application and audit logs for work_items create and update events with anomalous title content
  • Correlate browser Content Security Policy (CSP) violation reports with work item page URLs to surface injection attempts

Monitoring Recommendations

  • Forward GitLab audit, application, and web server logs to a centralized analytics platform for retention and query
  • Alert on sequences where a work item title update is followed by privileged API actions from a different user within a short window
  • Monitor for session token reuse from new IP addresses or user agents after work item views by administrators or maintainers

How to Mitigate CVE-2025-6186

Immediate Actions Required

  • Upgrade self-managed GitLab CE/EE to version 18.1.4, 18.2.2, or later as published by GitLab
  • Audit work item names created or edited since the vulnerable versions were deployed and remove or sanitize entries containing HTML markup
  • Rotate personal access tokens, session cookies, and OAuth tokens for any account that may have viewed a malicious work item

Patch Information

GitLab resolved the issue in versions 18.1.4 and 18.2.2. GitLab.com SaaS instances are patched by the vendor. Self-managed administrators should follow the standard GitLab upgrade procedure and verify the running version after upgrade. Review the tracking issue at GitLab Issue #549844 for the fix reference.

Workarounds

  • Restrict work item creation and edit permissions to trusted users where feasible until the upgrade is applied
  • Enforce a strict Content Security Policy (CSP) at the reverse proxy to limit inline script execution in the GitLab UI
  • Require administrators to use separate browser profiles or sessions when reviewing untrusted project content
bash
# Example: verify installed GitLab version after upgrade
sudo gitlab-rake gitlab:env:info | grep -i "GitLab information" -A 5

# Example: list recent work item title changes via API for audit
curl --header "PRIVATE-TOKEN: <admin_token>" \
  "https://gitlab.example.com/api/v4/projects/<id>/issues?order_by=updated_at"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.