Campaign or TTP Overview
In early 2026, a significant vulnerability, designated CVE-2026-19478, was discovered in GitLab’s GraphQL API. This vulnerability allowed attackers to perform directive code injection, leading to unauthorized manipulation of public projects and user data. The vulnerability gained traction among cybercriminals, quickly becoming a preferred attack vector for compromising GitLab instances. The flaw permitted the injection of arbitrary code via GraphQL directives, which subsequently executed unwanted commands as if the attacker had valid user permissions.
The targeting initially focused on large-scale public GitLab instances used by enterprises and open-source projects, seeking to exploit high-value repositories. Researchers attributed the first wave of attacks to a group known for leveraging zero-day vulnerabilities to siphon intellectual property and disrupt operations as part of broader cyber-espionage campaigns. This group exploited the vulnerability from January through March 2026, adapting their methods as needed to bypass evolving defenses.
The exploitation of CVE-2026-19478 underscores the critical importance of rigorous application security testing and patch management.
How It Was Built
The TTP leveraged a specifically crafted GraphQL query that embedded malicious directives directly into the GitLab API requests. Attackers first conducted reconnaissance to identify instances with exposed APIs and valid GraphQL query capabilities. Once an exploitable instance was found, the attack proceeded with a strategically designed API request:
POST /api/graphql HTTP/1.1
Host: vulnerable-gitlab-instance.com
Content-Type: application/json
Content-Length: ###
{
"query": "query { project(fullPath: "group/project") { repository { blobs { nodes { ... on Blob { webUrl, size @include(if: false) @skip(unless: true) } } } } } }",
"variables": {},
"operationName": null
}
The payload embedded in this request subtly manipulated GraphQL directives to execute operations leading to data leakage or modification. Once the malicious code executed, attackers could alter repository contents, expose private data, or delete key project files. The delivery of these queries was typically automated through scripts running on compromised servers, allowing for rapid, widespread deployment.
Why It Worked
Three main factors contributed to the success of these attacks:
- API Exposure: Many GitLab instances inadvertently exposed their GraphQL APIs to the internet without adequate restrictions. This exposure allowed attackers to send queries from anywhere, effectively bypassing network perimeter controls.
- GraphQL Flexibility: The inherent flexibility of GraphQL in querying diverse datasets facilitated complex directive exploitation. Attacks leveraged nested queries to inject behavior into seemingly benign operations, effectively concealing their intent.
- Lack of Authentication: Some instances failed to authenticate requests properly, especially those where project settings were misconfigured to over-grant access. This oversight enabled attackers to execute commands without prior authentication.
Operator Takeaways
For red team operators, the key learning points from this campaign include:
- Emulate Legitimate Use: Look to leverage technical specifications like GraphQL APIs that allow complex queries as entry points to simulate real-world exploitation techniques effectively.
- Automate for Scale: Successful campaigns utilized automation to test multiple endpoints rapidly. Build scripts that can dynamically adjust payloads based on target responses, adapting to different instance configurations.
- Customize Payloads: Tailoring payloads to exploit specific API query fields or directives demonstrated how flexibility in query construction could achieve results without obvious detection.
Do’s and Don’ts
Do’s
- Exploit Flexibility: Use the inherent flexibility in scripting and APIs to craft payloads that adapt to the target environment.
- Conduct Thorough Reconnaissance: Gather detailed information on target configurations to refine attack vectors and payload delivery methods.
Don’ts
- Neglect Obfuscation: Avoid sending direct payloads without considering the need for obfuscation to evade detection mechanisms.
- Overlook Rate Limiting: Be aware of potential security controls like rate limiting that can disrupt scripted attacks; plan and stagger execution accordingly.
References
For further information on CVE-2026-19478, see the detailed analysis by Horizon3.ai.
Related Reading
- Exploiting MLflow SSRF Vulnerability: Emerging Attack Techniques
- Exploiting Metabase SQL Injection: Current Threat Actor Campaign Patterns
- What is Code Injection in Phishing?
- What is Metadata Service Exploitation in Phishing?
Educational Purpose: This content is provided for awareness and defensive purposes only. Understanding attacker methodologies helps individuals and organizations protect themselves.

