CVE-2026-2973 in Community Editioninfo

Summary

by MITRE • 03/25/2026

GitLab has remediated an issue in GitLab CE/EE affecting all versions from 17.7 before 18.8.7, 18.9 before 18.9.3, and 18.10 before 18.10.1 that could have allowed an authenticated user to execute arbitrary JavaScript in a user's browser due to improper sanitization of entity-encoded content in Mermaid diagrams.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 04/01/2026

This vulnerability exists within GitLab's Mermaid diagram rendering functionality where improperly sanitized entity-encoded content could lead to cross-site scripting attacks. The flaw affects GitLab Community Edition and Enterprise Edition across multiple version ranges including 17.7 through 18.8.6, 18.9 through 18.9.2, and 18.10 through 18.10.0. The security issue stems from insufficient input validation and sanitization of user-supplied data within Mermaid diagram markup, which allows authenticated attackers to inject malicious JavaScript code that executes in the context of other users' browsers. This represents a classic server-side template injection vulnerability that manifests as client-side script execution, creating a dangerous privilege escalation vector for authenticated users.

The technical implementation of this vulnerability occurs when GitLab processes Mermaid diagram syntax within markdown content, specifically failing to properly decode and sanitize entity-encoded characters before rendering the diagrams. Attackers can exploit this by crafting malicious Mermaid diagrams containing encoded javascript payloads that bypass the application's security filters. The vulnerability maps directly to CWE-79: Improper Neutralization of Input During Web Page Generation, which addresses the failure to sanitize user input that gets rendered as web content. This weakness allows attackers to inject malicious scripts that can steal session cookies, perform actions on behalf of victims, or redirect users to malicious sites. The attack requires only authenticated access to the GitLab instance, making it particularly dangerous in environments where users have write permissions to project documentation or issue tracking features.

The operational impact of this vulnerability extends beyond simple script execution as it enables sophisticated attack vectors including session hijacking, data exfiltration, and persistent browser-based malware delivery. An attacker with access to a GitLab project can embed malicious Mermaid diagrams in documentation, issue descriptions, or merge request comments that will execute when other users view these elements. The vulnerability affects the browser-based rendering context rather than the server, making it particularly challenging to detect through traditional network monitoring. According to ATT&CK framework, this maps to T1566.001: Phishing: Spearphishing Attachment, as attackers can use the vulnerability to deliver malicious content through legitimate project documentation. The attack chain typically involves crafting a malicious Mermaid diagram with encoded javascript, uploading it to a project, and waiting for another user to view the rendered content, which then executes the payload in their browser context.

Mitigation strategies for this vulnerability include immediate upgrade to the patched versions mentioned in the advisory, specifically 18.8.7, 18.9.3, and 18.10.1 respectively. Organizations should also implement additional security controls such as restricting write permissions to project documentation for untrusted users, implementing content security policies that limit script execution, and monitoring for unusual Mermaid diagram usage patterns. The patch addresses the core sanitization issue by properly decoding and validating entity-encoded content before rendering. Additional defensive measures include implementing web application firewalls to detect and block suspicious Mermaid syntax patterns, conducting regular security assessments of user-generated content, and establishing incident response procedures for potential exploitation attempts. Organizations should also consider implementing automated scanning tools that can detect potentially malicious Mermaid diagrams in their GitLab instances, particularly in environments where multiple users have write access to documentation features.

Responsible

GitLab

Reservation

02/22/2026

Disclosure

03/25/2026

Moderation

accepted

CPE

ready

EPSS

0.00042

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!