/

CVE-2026-40173

Severity:

CRITICAL RISK

(9.4)

Information Disclosure in Dgraph Alpha

CVE-2026-40173

Analyzed

Vulnerability type

Category:

Information Disclosure

CWE:

CWE-200, CWE-215, CWE-522

Impact:

Unauthorized Privileged Access via Token Leakage

Severity:

CRITICAL RISK

(9.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Dgraph Alpha exposes its /debug/pprof/cmdline endpoint on the default HTTP mux without authentication, leaking the full process command line including the configured admin token.

An attacker who can reach the Alpha HTTP port can extract this token and reuse it in the X-Dgraph-AuthToken header to invoke admin-only endpoints, gaining unauthorized privileged control over configuration and operations.

Affected context

This vulnerability affects Dgraph Alpha deployments that:

  • Are running versions 25.3.1 or earlier
  • Use the --security "token=..." startup flag to protect admin endpoints
  • Expose the Alpha HTTP port (including /debug/* endpoints) to networks where untrusted users, services, or attackers can send requests

The issue arises because the /debug/pprof/cmdline endpoint is registered on the default HTTP mux without being wrapped by the admin authentication handler, allowing unauthenticated retrieval of the process command line and associated secrets.

Exploit preconditions

  • Attack surface: Dgraph Alpha HTTP interface, specifically the /debug/pprof/cmdline endpoint.
  • Required access: Network reachability to the Alpha HTTP port from an untrusted or attacker-controlled environment; no prior authentication needed.
  • Trigger point: Sending an HTTP request to /debug/pprof/cmdline on the Alpha instance, then reusing the leaked admin token in the X-Dgraph-AuthToken header against admin-only endpoints (e.g., /admin/config/cache_mb).
  • Why exploitation is possible: The debug profiling endpoint is:
  • Exposed on the default mux without authentication or authorization checks, and
  • Returns the full process command line which embeds the admin token configured via --security "token=...",

allowing an attacker to obtain credentials intended to gate privileged admin operations.

Why this happens

The core issue is an information exposure flaw in debug functionality, where sensitive configuration is unintentionally made accessible to unauthenticated users.

From a vulnerability-class perspective, this maps primarily to CWE-200: Exposure of Sensitive Information to an Unauthorized Actor and is closely related to CWE-215: Insertion of Sensitive Information Into Debugging Code. The Dgraph Alpha process embeds the admin token in its startup command line, and the /debug/pprof/cmdline endpoint is:

  • Exposed by default as part of the Go net/http/pprof handlers,
  • Registered on an HTTP mux that does not enforce admin authentication,
  • Returning raw command-line arguments verbatim.

This creates an insecure pattern where debugging and profiling endpoints leak operational secrets (in this case, the admin token) that are then accepted by the same service as proof of administrative authority. The underlying design flaw is treating debug/operational interfaces as implicitly trusted and failing to apply the same access control boundaries as production admin APIs.

Potential impact

  • Unauthorized use of the leaked admin token to access privileged admin endpoints.
  • Modification of cache settings and other configuration via endpoints such as /admin/config/cache_mb.
  • Execution of operational control actions (e.g., toggling features, adjusting resource usage, invoking maintenance operations) reserved for administrators.
  • Potential disruption of service availability through misconfiguration or aggressive cache and resource changes.
  • Facilitation of broader compromise if admin APIs allow modifications to security-related settings, schemas, or data paths.
  • Abuse of the administrative position to aid data exfiltration or tampering through subsequent admin-driven operations.

General mitigation guidance

Effective mitigation focuses on reducing information exposure from debug interfaces, hardening credential handling, and tightening network and privilege boundaries:

  • Isolate debug and profiling endpoints:
  • Ensure debug interfaces such as /debug/pprof/* are not exposed to untrusted networks.
  • Prefer binding debug ports to localhost or to a dedicated management network accessible only to operations staff.
  • Decouple secrets from the command line:
  • Avoid passing tokens or other secrets in process command-line flags where possible.
  • Prefer environment variables or dedicated configuration files with restricted filesystem permissions and access controls.
  • Enforce consistent authentication on admin paths:
  • Treat debug/operational endpoints as sensitive, applying the same or stricter authentication mechanisms as admin APIs.
  • Centralize HTTP handler registration through a wrapper that enforces access control to reduce the risk of unauthenticated paths.
  • Apply network-layer defense in depth:
  • Use firewalls, service meshes, or API gateways to restrict who can reach the Alpha HTTP port.
  • Segregate admin and data-plane traffic where possible, minimizing exposure of administrative endpoints.
  • Harden operational practices:
  • Avoid using easily guessable or reused admin tokens.
  • Rotate admin tokens when deployment or configuration changes occur, and especially after any suspected exposure.

How teams detect issues like this

Detection generally involves a combination of configuration review, traffic monitoring, and code or deployment analysis:

  • Configuration and infrastructure review:
  • Audit Dgraph deployments to identify where /debug/* endpoints are exposed to non-admin networks.
  • Inspect startup configurations for use of secrets in command-line flags, especially under --security.
  • Network and log monitoring:
  • Monitor HTTP access logs for requests to /debug/pprof/cmdline, especially from unexpected IP ranges or unauthenticated clients.
  • Correlate access to debug endpoints with subsequent use of X-Dgraph-AuthToken from the same source, which may indicate token harvesting and reuse.
  • Static and policy-based analysis:
  • Use static analysis or configuration linting rules to flag services that:
  • Register debug/pprof handlers on public muxes, or
  • Include secrets in command-line parameters.
  • Introduce policy checks in CI/CD pipelines that disallow exposing debug endpoints on production-facing ports without explicit exceptions.
  • Automated security testing:
  • Include checks in automated security scans to probe accessible /debug/* endpoints and verify that they do not leak sensitive configuration or credentials.

Sources

SourceLink
github.comgithub.com/dgraph-io/dgraph/releases/tag/v25.3.2
github.comgithub.com/dgraph-io/dgraph/security/advisories/GHSA-95mq-xwj4-r47p

Frequently asked

questions

Yes, if the Dgraph Alpha HTTP port is reachable from an untrusted network, an attacker can remotely access /debug/pprof/cmdline without authentication and retrieve the admin token, then use it to call admin endpoints.

No. The attack only requires network reachability to the vulnerable Alpha HTTP interface. The debug endpoint does not perform authentication, so no existing credentials are needed to obtain the token.

The most robust pattern is to remove or tightly restrict any unauthenticated debug or profiling endpoints and ensure that secrets are never embedded in command-line arguments. All operational and administrative endpoints should be consistently protected by strong authentication and ideally isolated on a management network.

Treat debug and profiling endpoints as sensitive surfaces: require authentication, restrict them to trusted networks, and avoid exposing them on public ports. Establish secure configuration practices that keep credentials out of command lines, enforce access control uniformly across handlers, and include checks for sensitive-data exposure in both code review and automated deployment pipelines.

Find out what's already
exploitable in your codebase.