CVE-2021-22182
GitLab vulnerability analysis and mitigation

Overview

An issue was discovered in GitLab affecting all versions starting with 13.7, where GitLab was vulnerable to a stored Cross-Site Scripting (XSS) in merge requests. The vulnerability was reported through GitLab's HackerOne bug bounty program and was assigned CVE-2021-22182 (GitLab Security Release, CVE Details).

Technical details

The vulnerability allowed an attacker to inject malicious scripts through the target branch section when creating a merge request. The XSS payload would be stored and executed when users viewed the merge request, particularly when clicking the 'Merge Immediately' button. While GitLab.com was protected due to Content Security Policy (CSP), self-hosted instances without proper CSP configuration were vulnerable (GitLab Issue).

Impact

The stored XSS vulnerability could be exploited in public projects where merge requests are accessible to everyone. When triggered, the malicious script would execute in the context of other users viewing the merge request, potentially leading to session hijacking, data theft, or other malicious actions (GitLab Security Release).

Exploitability

The vulnerability could be exploited by creating a merge request with a specially crafted target branch name containing XSS payload. The exploit was confirmed to work in public projects, making it accessible to any authenticated user with the ability to create merge requests (GitLab Issue).

Mitigation and workarounds

The vulnerability was patched in GitLab versions 13.8.2, 13.7.6, and 13.6.6. GitLab strongly recommended that all installations running affected versions be upgraded to one of these patched versions immediately. Additionally, implementing proper Content Security Policy (CSP) could help mitigate such XSS attacks (GitLab Security Release).

Additional resources


SourceThis report was generated using AI

Related GitLab vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-19478CRITICAL9.4
  • GitLab logoGitLab
  • cpe:2.3:a:gitlab:gitlab
NoYesAug 17, 2026
CVE-2026-10053HIGH8.5
  • GitLab logoGitLab
  • cpe:2.3:a:gitlab:gitlab
NoYesAug 23, 2026
CVE-2026-19650HIGH7.1
  • GitLab logoGitLab
  • cpe:2.3:a:gitlab:gitlab
NoYesAug 17, 2026
CVE-2026-6821MEDIUM4.3
  • GitLab logoGitLab
  • cpe:2.3:a:gitlab:gitlab
NoYesAug 12, 2026
CVE-2026-4879MEDIUM4.3
  • GitLab logoGitLab
  • cpe:2.3:a:gitlab:gitlab:*:*:*:*:enterprise:*:*:*
NoYesAug 12, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management