CVE-2026-41327: Dgraph: Pre-Auth Full Database Exfiltration via DQL Injection in Upsert Condition Field
A vulnerability has been found in Dgraph that gives an unauthenticated attacker full read access to every piece of data in the database. This affects Dgraph’s default configuration where ACL is not enabled.
The attack is a single HTTP POST to /mutate?commitNow=true containing a crafted cond field in an upsert mutation. The cond value is concatenated directly into a DQL query string via strings.Builder.WriteString after only a cosmetic strings.Replace transformation. No escaping, parameterization, or structural validation is applied. An attacker injects an additional DQL query block into the cond string, which the DQL parser accepts as a syntactically valid named query block. The injected query executes server-side and its results are returned in the HTTP response.
There are no credentials involved. When ACL is disabled (the default), the /mutate endpoint requires no authentication. The authorizeQuery and authorizeMutation functions both return nil immediately when AclSecretKey is not configured. Even when ACL is enabled, a user with mutation-only permission can inject read queries that bypass per-predicate ACL authorization, because the injected query block is not subject to the normal authorization flow.
POC clip:
https://github.com/user-attachments/assets/edf43615-b0d5-46cd-abd9-2cb9423790d2
| Field | Value |
|---|---|
| Title | Pre-Auth DQL Injection via Unsanitized Cond Field in Upsert Mutations |
| Type | Injection |
| CWE | CWE-943 (Improper Neutralization of Special Elements in Data Query Logic) |
| CVSS | 9.8 |
References
Code Behaviors & Features
Detect and mitigate CVE-2026-41327 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →