Skip to content
Submit incident
AII-1002-42899
ConfirmedA court, a regulator or the organization itself has stated the core facts, or the record cites a court or regulator source.

GitLab Resolve Vulnerability feature vulnerable to prompt injection

GitLab's Resolve Vulnerability feature uses an LLM to generate security patches but fails to sanitize user-controlled fields from SAST reports before inserting them into the LLM prompt. Attackers can inject prompt instructions via crafted SAST reports to make the LLM generate malicious code patches that expose sensitive pipeline secrets.

22 August 2024 Β· GitLab Β· Security and cyberattacks
22 August 2024
AII-1002-428992 sources ↓
Quick facts
Organization
GitLab (subject)
Category
Security and cyberattacks
Source
gitlab.com
Date
22 August 2024
Drafted by
Raidu Incident Detection

What happened

GitLab's 'Resolve Vulnerability' feature uses an LLM to generate code patches from SAST vulnerability reports. The feature formats SAST report fields including filename, vulnerable_code, title, and identifiers into an LLM prompt without sanitizing user-controlled input.

An attacker can craft a malicious SAST report containing prompt injection instructions in fields like vulnerability identifiers. When a victim uses the Resolve Vulnerability feature on the attacker's crafted report, the injected instructions are executed by the LLM, which then generates a code patch containing the attacker's desired content.

Reported impact

The injected instructions execute in the context of the victim's pipeline, potentially allowing attackers to expose sensitive values such as CI job tokens that are logged to the job output.

Index analysis

The vulnerability stems from improper neutralization of special elements in the LLM prompt. SAST report fields that are attacker-controllable are inserted directly into the prompt template without escaping or validation, allowing prompt injection attacks.

Classification

Organization
GitLab (subject)
Category
Security and cyberattacks
Industry
Digital security
Harm status
Potential harm
Intent
Unintentional
Timing
Post-deployment
Harmed
Business
Failure modes
Prompt injection, Data leak
AI systems
Claude

Sources and evidence

This record was researched and written by the Index, based on the following original reporting.

gitlab.com
https://gitlab.com/gitlab-org/gitlab/-/issues/472603
cve.org
NVD entry