Dgraph: Pre-Auth Full Database Exfiltration via DQL Injection in NQuad Lang 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 requires two HTTP POSTs to port 8080. The first sets up a schema predicate with @unique @index(exact) @lang via /alter (also unauthenticated in default config). The second sends a crafted JSON mutation to /mutate?commitNow=true where a JSON key contains the predicate name followed by @ and a DQL injection payload in the language tag position.
The injection exploits the addQueryIfUnique function in edgraph/server.go, which constructs DQL queries using fmt.Sprintf with unsanitized predicateName that includes the raw pred.Lang value. The Lang field is extracted from JSON mutation keys by x.PredicateLang(), which splits on @, and is never validated by any function in the codebase. The attacker injects a closing parenthesis to escape the eq() function, adds an arbitrary named query block, and uses a # comment to neutralize trailing template syntax. The injected query executes server-side and its results are returned in the HTTP response.
POC clip:
https://github.com/user-attachments/assets/bbfb7bba-c957-4b57-b534-48a958314186
CVSS 3.1: 9.1 (Critical)
```
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
```
| Metric | Value | Rationale |
| ------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Attack Vector | Network | HTTP POST to port 8080 |
| Attack Complexity | Low | Two requests, deterministic outcome, no special conditions |
| Privileges Required | None | No authentication when ACL is disabled (default) |
| User Interaction | None | Fully automated |
| Scope | Unchanged | Stays within the Dgraph data layer |
| Confidentiality | High | Full database exfiltration: all nodes, all predicates, all values |
| Integrity | High | The mutation that carries the injection also writes data; the attacker can also set up arbitrary schema via unauthenticated /alter |
| Availability | None | No denial of service |
| Field | Value |
| ----- | --------------------------------------------------------------------------- |
| Title | Pre-Auth DQL Injection via Unsanitized NQuad Lang Field in addQueryIfUnique |
| Type | Injection |
| CWE | CWE-943 (Improper Neutralization of Special Elements in Data Query Logic) |
| CVSS | 9.8 |
| Field | Value |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| Project | Dgraph |
| Repository | [https://github.com/dgraph-io/dgraph](https://github.com/dgraph-io/dgraph) |
| Tested version | v25.3.0 |
| Lang split | x/x.go line 919 (PredicateLang splits on @, returns everything after as Lang) |
| Lang assignment | chunker/json_parser.go line 524 (nq.Predicate, nq.Lang = x.PredicateLang(nq.Predicate)) |
| Validation gap | edgraph/server.go line 2142 (validateKeys checks nq.Predicate only, never nq.Lang) |
| Injection sink | `edgraph
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability none.
The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
CVE-2026-41328 is classified as CWE-943: Improper Neutralization of Special Elements in Data Query Logic. The product generates a query intended to access or manipulate data in a data store such as a database, but it does not neutralize or incorrectly neutralizes special elements that can modify the intended logic of the query.
CVE-2026-41328 is recorded against 5 packages.
Published on 24 April 2026 and last revised on 17 June 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from NVD.
dgraph has other advisories on record. If you are patching this one, these are worth checking on the same host:
These advisories are the same class of weakness (CWE-943: Improper Neutralization of Special Elements in Data Query Logic) in other software:
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| dgraph | — | 25.3.3 |
| github.com/dgraph-io/dgraph | — | — |
| github.com/dgraph-io/dgraph/v24 | — | — |
| github.com/dgraph-io/dgraph/v25 | — | — |
| github.com/hypermodeinc/dgraph/v24 | — | — |
References
Similar Threats
Exploit Protection
CVE-2026-41328 carries CVSS 9.5 Critical rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2026-41328 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.
Stay up to date with the latest from Boteraser.
We use cookies to improve your experience on our site. By using our site, you consent to cookies.
Manage your cookie preferences below:
Essential cookies enable basic functions and are necessary for the proper function of the website.
CloudFlare provides web performance and security solutions, enhancing site speed and protecting against threats.
Service URL: developers.cloudflare.com (opens in a new window)
These cookies are needed for adding comments on this website.
These cookies are used for managing login functionality on this website.
Statistics cookies collect information anonymously. This information helps us understand how visitors use our website.
Google Analytics is a powerful tool that tracks and analyzes website traffic for informed marketing decisions.
Service URL: policies.google.com (opens in a new window)
You can find more information in our Cookie Policy and Privacy Policy.