CVE-2021-22170
GitLab vulnerability analysis and mitigation

Overview

CVE-2021-22170 is a cryptographic vulnerability affecting GitLab versions 11.6 and later. The vulnerability stems from nonce reuse issues in the encryption implementation, which could allow an attacker to decrypt encrypted database content in the event of a database breach (NVD).

Technical details

The vulnerability exists in the Gitlab::CryptoHelper module, which uses AES-GCM encryption with static key and nonce values derived from Gitlab::Application.secrets.dbkeybase. The implementation has multiple issues: the key and IV (nonce) are related to each other, with the IV being a substring of the key, and both values are derived from a hexadecimal string, effectively making them half as long as intended. The CVSS v3.1 score is 7.5 (High) according to NVD assessment (GitLab Issue).

Impact

In the event of a database breach, the nonce reuse vulnerability allows attackers to recover the authentication key used within AES-GCM. By observing two different ciphertexts and their authentication tags, attackers can forge authentication tags for arbitrary ciphertexts. Additionally, if a plain/ciphertext pair is known (such as from a project's runners token), attackers can deduce the keystream and encrypt arbitrary values up to the length of the known pair (GitLab Issue).

Mitigation and workarounds

The recommended mitigation involves storing a random IV along with the encrypted value and deriving the key from Gitlab::Application.secrets.dbkeybase using a secure key derivation function such as PBKDF2 (GitLab Issue).

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-2024-9183HIGH7.7
  • GitLabGitLab
  • cpe:2.3:a:gitlab:gitlab
NoYesDec 05, 2025
CVE-2025-7449MEDIUM6.5
  • GitLabGitLab
  • cpe:2.3:a:gitlab:gitlab:*:*:*:*:enterprise:*:*:*
NoYesNov 26, 2025
CVE-2025-12653MEDIUM6.5
  • GitLabGitLab
  • gitlab
NoYesNov 26, 2025
CVE-2025-13611MEDIUM5.3
  • GitLabGitLab
  • cpe:2.3:a:gitlab:gitlab:*:*:*:*:enterprise:*:*:*
NoYesNov 26, 2025
CVE-2025-6195MEDIUM4.3
  • GitLabGitLab
  • gitlab
NoYesNov 26, 2025

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