ADVISORIES

Go Vulnerability Database

GO-2026-5516

Pre-Auth DQL injection in upsert condition field in github.com/dgraph-io/dgraph

Details

A DQL injection vulnerability in Dgraph allows an unauthenticated remote attacker to exfiltrate data from the database.

The injection occurs via the "cond" field in upsert mutations. The buildUpsertQuery function fails to properly validate the condition string, allowing an attacker to craft a payload that closes the intended @if clause and appends arbitrary DQL query blocks. These injected blocks execute with the privileges of the Dgraph process, potentially leading to full database exfiltration.

Affected packages

EcosystemPackageAffected versions
Gogithub.com/dgraph-io/dgraph
All versions, no fix listed
Gogithub.com/dgraph-io/dgraph/v25
All versions before 25.3.3 (fixed in 25.3.3)
Gogithub.com/hypermodeinc/dgraph/v24
All versions before 24.1.8 (fixed in 24.1.8)

References