CVE-2026-40173: Dgraph Unauthenticated /debug/pprof/cmdline Discloses Admin Auth Vulnerability

CRITICAL
Advisory Identifier: GHSA-95mq-xwj4-r47p
CVSS 9.4
CWE-522 CWE-215 CWE-200
Published
Advisory Summary

CVE-2026-40173 is a CRITICAL (CVSS 9.4) unauthenticated /debug/pprof/cmdline discloses admin auth vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Dgraph libraries in the Go ecosystem. The issue involves unauthenticated /debug/pprof/cmdline discloses admin auth token, enabling unauthorized access to protected alpha admin endpoints. Remediation is available by upgrading affected packages to version 25.3.2.

CVE-2026-40173 at a Glance

CVE Identifier CVE-2026-40173
GHSA Identifier GHSA-95mq-xwj4-r47p
Severity CRITICAL
CVSS v3.1 Base Score 9.4
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product Dgraph
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 9.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2026-40173

To remediate this vulnerability, upgrade all affected Dgraph dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/dgraph-io/dgraph/v25 fixed: 25.3.2
Upgrade github.com/dgraph-io/dgraph/v25 to 25.3.2
github.com/dgraph-io/dgraph/v24 fixed: Latest secure release
Upgrade github.com/dgraph-io/dgraph/v24 to Latest secure release
github.com/dgraph-io/dgraph fixed: Latest secure release
Upgrade github.com/dgraph-io/dgraph to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/dgraph-io/dgraph/v25

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-40173, inspect your project dependencies for Dgraph:

inspect dependencies for github.com/dgraph-io/dgraph/v25

Analyze the terminal output to locate any version of Dgraph in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 25.3.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Dgraph, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary An unauthenticated debug endpoint in Dgraph Alpha exposes the full process command line, including the configured admin token from `--security "token=..."`. This does not break token validation logic directly; instead, it discloses the credential and enables unauthorized admin-level access by reusing the leaked token in `X-Dgraph-AuthToken`. ### Details The behavior occurs entirely within core Alpha HTTP routing and does not require any external proxy, plugin, or non-core integration. The core issue is not that admin token protection is absent, but that the protected secret is exposed in cleartext through an unauthenticated core debug endpoint. Relevant code paths: - `dgraph/cmd/alpha/run.go:17` imports `net/http/pprof`, which registers `/debug/pprof/*` handlers on the default mux. - `dgraph/cmd/alpha/run.go:533` uses `http.Handle("/", audit.AuditRequestHttp(baseMux))`, so default-mux handlers remain reachable. - `dgraph/cmd/alpha/admin.go:52` enforces admin token checks in `adminAuthHandler` for admin endpoints. - `dgraph/cmd/alpha/admin.go:74` shows `/admin/config/cache_mb` behind `adminAuthHandler`. Credential-exposure chain: 1. `/debug/pprof/cmdline` is reachable without authentication. 2. Its output includes the configured admin token from process arguments. 3. The disclosed token is accepted by `adminAuthHandler` when sent as `X-Dgraph-AuthToken`. 4. An attacker gains unauthorized access to admin-only functionality. Observed local evidence (safe validation): - Request: `GET /admin/config/cache_mb` without token - Status: 200 (request rejected at application layer) - Body contains error: `Invalid X-Dgraph-AuthToken` - The endpoint returns HTTP 200 but indicates authentication failure in the response body. - Request: `GET /debug/pprof/cmdline` without token - Status: 200 - Body excerpt includes: `--security=token=TopSecretToken123;` - Request: `GET /admin/config/cache_mb` with `X-Dgraph-AuthToken: TopSecretToken123` - Status: 200 - Body: `4096` Important policy/triage clarification: - This issue persists even when the admin-token security feature is enabled: the token itself is exposed via an unauthenticated core debug endpoint, making this more than a misconfiguration-only concern. - Network restrictions (bind/whitelist/firewall) may reduce exposure, but they do not remediate the underlying credential disclosure behavior. ### PoC - Branch: `main` - Commit: `b15c87e93` - Describe: `v25.3.1` Preconditions: - Alpha HTTP port is reachable by attacker traffic. - Admin token is configured via supported startup flag: `--security "token=..."`. - `/debug/pprof/*` is exposed on the same Alpha HTTP listener. - This behavior occurs with documented startup flags and without any non-default or unsupported configuration. Reproduction steps: 1. Start Zero and Alpha (example local setup): - `dgraph zero --my=127.0.0.1:5280 --port_offset=200 --bindall=false --wal=./zw` - `dgraph alpha --my=127.0.0.1:7280 --zero=127.0.0.1:5280 --port_offset=200 --bindall=false --security "token=TopSecretToken123;" --postings=./p --wal=./w --tmp=./t` 2. Verify admin endpoint rejects unauthenticated request: - `curl -i http://127.0.0.1:8280/admin/config/cache_mb` - Expected body includes `Invalid X-Dgraph-AuthToken`. 3. Read token from unauthenticated debug endpoint: - `curl -s http://127.0.0.1:8280/debug/pprof/cmdline` - Expected output includes `--security=token=TopSecretToken123;`. 4. Reuse leaked token against admin endpoint: - `curl -i -H "X-Dgraph-AuthToken: TopSecretToken123" http://127.0.0.1:8280/admin/config/cache_mb` - Expected: successful response (example observed: `4096`). Note: The PoC uses `127.0.0.1` only for safe local validation. The vulnerable condition is unauthenticated reachability of `/debug/pprof/cmdline`; in any deployment where Alpha HTTP is reachable by untrusted parties, the same token disclosure and subsequent unauthorized admin access apply. ### Impact - Unauthenticated disclosure of a sensitive admin credential via debug endpoint, enabling unauthorized privileged administrative access through token reuse - Operators running Dgraph Alpha with admin token configured, where Alpha HTTP/debug routes are reachable by untrusted users or networks. The attack requires network reachability to the Alpha HTTP port. In deployments where this interface is exposed beyond trusted boundaries, the issue is remotely exploitable without authentication. Depending on exposed admin functionality in deployment policy, this may allow configuration changes, operational control actions, and other privileged administrative operations exposed through `/admin/*`.

CVE-2026-40173 Affected Dgraph Versions

3 component(s)
Fixed Versions:
25.3.2
Product / Package Ecosystem Affected Versions Fixed Version
github.com/dgraph-io/dgraph/v25
Go
< 25.3.2
25.3.2
github.com/dgraph-io/dgraph/v24
Go
≤ 24.1.7
github.com/dgraph-io/dgraph
Go
≤ 1.2.8

References

Frequently Asked Questions

What is CVE-2026-40173?
CVE-2026-40173 is a security vulnerability in Dgraph involving Unauthenticated /debug/pprof/cmdline discloses admin auth token, enabling unauthorized access to protected Alpha admin endpoints under CWE-522: Insufficiently Protected Credentials.
Which Dgraph versions are affected?
Affected versions include releases prior to 25.3.2 across affected packages: github.com/dgraph-io/dgraph/v25, github.com/dgraph-io/dgraph/v24, github.com/dgraph-io/dgraph.
What version fixes CVE-2026-40173?
Upgrading to 25.3.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/dgraph-io/dgraph/v25 affected?
Yes, github.com/dgraph-io/dgraph/v25 is affected in releases prior to 25.3.2. Upgrade your dependency to 25.3.2 or later.
Is github.com/dgraph-io/dgraph/v24 affected?
Yes, github.com/dgraph-io/dgraph/v24 is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-40173?
CVE-2026-40173 has a CVSS v3.1 base score of 9.4 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L.
What CWE is associated with CVE-2026-40173?
CVE-2026-40173 is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check Go dependencies for CVE-2026-40173?
Run the dependency tree command: 'inspect dependencies for github.com/dgraph-io/dgraph/v25'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-95mq-xwj4-r47p",
  "modified" : "2026-04-16T21:08:07Z",
  "published" : "2026-04-16T21:08:07Z",
  "aliases" : [ "CVE-2026-40173" ],
  "summary" : "Dgraph: Unauthenticated /debug/pprof/cmdline discloses admin auth token, enabling unauthorized access to protected Alpha admin endpoints",
  "details" : "### Summary\nAn unauthenticated debug endpoint in Dgraph Alpha exposes the full process command line, including the configured admin token from `--security \"token=...\"`.\n\nThis does not break token validation logic directly; instead, it discloses the credential and enables unauthorized admin-level access by reusing the leaked token in `X-Dgraph-AuthToken`.\n\n### Details\nThe behavior occurs entirely within core Alpha HTTP routing and does not require any external proxy, plugin, or non-core integration.\n\nThe core issue is not that admin token protection is absent, but that the protected secret is exposed in cleartext through an unauthenticated core debug endpoint.\n\nRelevant code paths:\n- `dgraph/cmd/alpha/run.go:17` imports `net/http/pprof`, which registers `/debug/pprof/*` handlers on the default mux.\n- `dgraph/cmd/alpha/run.go:533` uses `http.Handle(\"/\", audit.AuditRequestHttp(baseMux))`, so default-mux handlers remain reachable.\n- `dgraph/cmd/alpha/admin.go:52` enforces admin token checks in `adminAuthHandler` for admin endpoints.\n- `dgraph/cmd/alpha/admin.go:74` shows `/admin/config/cache_mb` behind `adminAuthHandler`.\n\nCredential-exposure chain:\n1. `/debug/pprof/cmdline` is reachable without authentication.\n2. Its output includes the configured admin token from process arguments.\n3. The disclosed token is accepted by `adminAuthHandler` when sent as `X-Dgraph-AuthToken`.\n4. An attacker gains unauthorized access to admin-only functionality.\n\nObserved local evidence (safe validation):\n- Request: `GET /admin/config/cache_mb` without token\n  - Status: 200 (request rejected at application layer)\n  - Body contains error: `Invalid X-Dgraph-AuthToken`\n  - The endpoint returns HTTP 200 but indicates authentication failure in the response body.\n- Request: `GET /debug/pprof/cmdline` without token\n  - Status: 200\n  - Body excerpt includes: `--security=token=TopSecretToken123;`\n- Request: `GET /admin/config/cache_mb` with `X-Dgraph-AuthToken: TopSecretToken123`\n  - Status: 200\n  - Body: `4096`\n\nImportant policy/triage clarification:\n- This issue persists even when the admin-token security feature is enabled: the token itself is exposed via an unauthenticated core debug endpoint, making this more than a misconfiguration-only concern.\n- Network restrictions (bind/whitelist/firewall) may reduce exposure, but they do not remediate the underlying credential disclosure behavior.\n\n### PoC\n\n- Branch: `main`\n- Commit: `b15c87e93`\n- Describe: `v25.3.1`\n\nPreconditions:\n- Alpha HTTP port is reachable by attacker traffic.\n- Admin token is configured via supported startup flag: `--security \"token=...\"`.\n- `/debug/pprof/*` is exposed on the same Alpha HTTP listener.\n- This behavior occurs with documented startup flags and without any non-default or unsupported configuration.\n\nReproduction steps:\n1. Start Zero and Alpha (example local setup):\n   - `dgraph zero --my=127.0.0.1:5280 --port_offset=200 --bindall=false --wal=./zw`\n   - `dgraph alpha --my=127.0.0.1:7280 --zero=127.0.0.1:5280 --port_offset=200 --bindall=false --security \"token=TopSecretToken123;\" --postings=./p --wal=./w --tmp=./t`\n\n2. Verify admin endpoint rejects unauthenticated request:\n   - `curl -i http://127.0.0.1:8280/admin/config/cache_mb`\n   - Expected body includes `Invalid X-Dgraph-AuthToken`.\n\n3. Read token from unauthenticated debug endpoint:\n   - `curl -s http://127.0.0.1:8280/debug/pprof/cmdline`\n   - Expected output includes `--security=token=TopSecretToken123;`.\n\n4. Reuse leaked token against admin endpoint:\n   - `curl -i -H \"X-Dgraph-AuthToken: TopSecretToken123\" http://127.0.0.1:8280/admin/config/cache_mb`\n   - Expected: successful response (example observed: `4096`).\n\nNote: The PoC uses `127.0.0.1` only for safe local validation. The vulnerable condition is unauthenticated reachability of `/debug/pprof/cmdline`; in any deployment where Alpha HTTP is reachable by untrusted parties, the same token disclosure and subsequent unauthorized admin access apply.\n\n### Impact\n\n- Unauthenticated disclosure of a sensitive admin credential via debug endpoint, enabling unauthorized privileged administrative access through token reuse\n- Operators running Dgraph Alpha with admin token configured, where Alpha HTTP/debug routes are reachable by untrusted users or networks.\n\nThe attack requires network reachability to the Alpha HTTP port. In deployments where this interface is exposed beyond trusted boundaries, the issue is remotely exploitable without authentication.\n\nDepending on exposed admin functionality in deployment policy, this may allow configuration changes, operational control actions, and other privileged administrative operations exposed through `/admin/*`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/dgraph-io/dgraph/v25"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "25.3.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/dgraph-io/dgraph/v24"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "24.1.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/dgraph-io/dgraph"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.2.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/dgraph-io/dgraph/security/advisories/GHSA-95mq-xwj4-r47p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40173"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/dgraph-io/dgraph"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/dgraph-io/dgraph/releases/tag/v25.3.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-215", "CWE-522" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-16T21:08:07Z",
    "nvd_published_at" : "2026-04-15T21:17:27Z"
  }
}