Summary
Dgraph Alpha exposes snapshot import RPCs on its public gRPC port without any authentication or authorization, allowing arbitrary clients to send snapshot data.
Under these conditions, an unauthenticated network attacker can trigger a database prepare operation that deletes and replaces the existing data store, leading to full data compromise.
Affected context
This vulnerability appears in Dgraph Alpha instances that:
- Expose the public gRPC port
:9080to untrusted networks or shared infrastructure - Have the external snapshot import RPCs (
StreamExtSnapshot) reachable via that port - Do not enforce authentication or authorization at the RPC layer
In such deployments, the snapshot import mechanism can be invoked by any network client that can connect to the gRPC endpoint, regardless of tenant or operational role.
Exploit preconditions
- Attack surface: Public or reachable Dgraph Alpha gRPC port
:9080 - Required access: Network-level ability to connect to the gRPC endpoint (no credentials required)
- Trigger point: Invocation of
StreamExtSnapshotand delivery of Badger stream data to the target group's store - Why exploitation is possible: The snapshot import RPCs lack authentication and authorization checks, and the receiver calls
Prepare()before processing, which deletes and replaces existing DB data purely based on the incoming request.
Why this happens
The underlying issue is a missing authentication and authorization control on sensitive administrative RPCs exposed via Dgraph Alpha's public gRPC interface.
This maps to CWE-306: Missing Authentication for Critical Function, where operations that can alter or destroy core system data are accessible without verifying the caller's identity or permissions.
Abstractly, the design trusts any client that can reach the port to perform high-impact snapshot import actions, conflating internal administrative operations with general network-facing APIs.
Potential impact
- An attacker can delete all existing data in the affected Dgraph group's store.
- An attacker may overwrite the database with attacker-controlled snapshot content.
- The service can experience integrity loss, data corruption, or application-level failures.
- There could be cascading impacts on dependent applications, including downtime and incorrect query results.
General mitigation guidance
Mitigation generally focuses on ensuring critical administrative operations are not exposed without strong identity and policy controls.
Common defensive patterns include:
- Segregating administrative RPCs onto non-public interfaces or management networks.
- Enforcing authentication and role-based authorization for snapshot and data import operations.
- Applying network access controls and firewall rules to restrict gRPC port access to trusted operators and services.
- Designing data-destructive actions to require explicit, multi-step confirmation or privileged channels, reducing the chance of misuse.
- Adopting least-privilege principles so only tightly controlled accounts can trigger prepare and snapshot import workflows.
How teams detect issues like this
Organizations can detect and manage similar risks through:
- Configuration and infrastructure reviews to identify services exposing administrative endpoints on public interfaces.
- Code review practices that flag RPC handlers capable of data deletion or replacement which lack authentication and authorization checks.
- Static analysis or service policy checks that look for high-impact operations not gated behind access control middleware.
- Runtime monitoring and logging focused on snapshot import and prepare actions, alerting on unusual or unauthenticated invocation patterns.

