logo

Port 50051 – gRPC (Default Port for gRPC over HTTP/2)

Service:

gRPC servers (grpc-gogrpc-javagRPC C++grpc-node)custom microservices

Protocol:

TCP

Port:

50051

Used for:

The conventional default port for gRPC servers — high-performance RPC between microservices using Protocol Buffers over HTTP/2

Port 50051 is the conventional default port for gRPC, Google’s high-performance RPC framework that carries Protocol Buffers messages over HTTP/2. It was never assigned to gRPC by IANA — it became the de facto default because gRPC’s official quickstarts, examples, and language tutorials all bind their sample servers to 50051, so a very large number of real-world microservices ship listening there without anyone ever changing it. What actually answers on an open 50051 is an HTTP/2 endpoint speaking gRPC framing: usually internal, service-to-service traffic between microservices, service-mesh sidecars, or an internal API. The security wrinkle that makes this port worth chasing is that gRPC has no built-in authentication and, on internal networks, is very often deployed in plaintext (h2c) with no TLS on the assumption that the network is trusted — so the first job on an open 50051 is to confirm it’s gRPC, check whether it’s encrypted, and see whether server reflection is switched on.

Why It’s Open

An open port 50051 almost always means a gRPC server — a microservice exposing RPC methods defined in a .proto file. gRPC is the default internal-communication choice for a huge slice of modern back ends: Kubernetes-hosted microservices, service meshes (Envoy, Linkerd, Istio use gRPC internally), streaming pipelines, and machine-learning inference servers (TensorFlow Serving, Triton, and many model servers speak gRPC). Because the framework’s tutorials, helloworld examples, and language-specific quickstarts across grpc-go, grpc-java, grpc C++, Python, and grpc-node all use 50051, developers copy that number straight into production, and it sticks.

Most of these services are meant to be reached only by other services inside a cluster or VPC — much like the unauthenticated dev and admin tools that cluster on port 9000, they’re built for a trusted network and quietly exposed when that assumption breaks. In practice they leak out through misconfigured Kubernetes ingress, a cloud security group left at 0.0.0.0/0, a debug deployment, or a gateway that forwards raw gRPC. When 50051 is reachable from somewhere it shouldn’t be, you’re usually looking at an internal API that was designed on the assumption nobody untrusted could ever talk to it — and was therefore built with the auth and transport security turned off.

Common Risks

  • No authentication by default. gRPC does not authenticate callers unless the developer wires it up (per-call tokens, mTLS, or an interceptor). A large share of internal gRPC services accept and execute any well-formed RPC from anyone who can reach the port.
  • Plaintext / no TLS (h2c). gRPC frequently runs as cleartext HTTP/2 (“h2c”) on internal networks, so requests, responses, and any tokens inside them are sniffable on the wire. TLS is opt-in, and “internal” services are routinely deployed without it.
  • Server reflection enabled — the recon jackpot. If the gRPC server reflection service is on, an attacker can enumerate every service, method, and message type without needing the .proto files at all. It is effectively Swagger/OpenAPI for gRPC: grpcurl list/describe hands over the full API surface for free.
  • Unauthenticated method invocation and broken authorization. With reflection giving you the method list and no auth enforced, you can call methods directly — including administrative or internal-only ones the UI would never expose. Even where some auth exists, authorization is often applied inconsistently, so calling an admin method straight over gRPC bypasses controls the front end enforces.
  • Message and deserialization issues. Protocol Buffers parsing has had real memory-safety and index-validation bugs in some codecs (see CVEs), and services that trust decoded fields without validation are exposed to logic and injection flaws.
  • HTTP/2 denial of service. Because gRPC rides on HTTP/2, it inherits HTTP/2 attack classes — most notably the 2023 Rapid Reset stream-cancellation DoS that hammered gRPC/HTTP-2 stacks.

Want to save time on reporting?

Let PentestPad generate, track, and export your reports - automatically.

logo-cta

Enumeration & Testing

The goal on port 50051 is to confirm it’s gRPC, determine whether it’s encrypted, and — the big win — check whether server reflection lets you enumerate the entire API without the .proto files.

Detect the service and version

Terminal window
nmap -sV -p 50051 <target>

Nmap will usually flag an HTTP/2 endpoint rather than name “gRPC” outright; treat an HTTP/2 service on 50051 as gRPC until proven otherwise and confirm with the tools below.

Check whether it’s TLS or plaintext (h2c)

Terminal window
openssl s_client -connect <target>:50051

A TLS handshake means the service is encrypted (use TLS-mode tools against it); an immediate failure or reset usually means plaintext h2c, so add -plaintext to every grpcurl call.

Enumerate services and methods via server reflection (the key step)

grpcurl is the primary gRPC recon tool and leans on server reflection:

Terminal window
# List every service the server exposes (needs reflection enabled)
grpcurl -plaintext <target>:50051 list
# Describe a service — dumps its methods and message schemas
grpcurl -plaintext <target>:50051 describe <package.Service>
# Describe a specific message type
grpcurl -plaintext <target>:50051 describe <package.MessageType>

grpc_cli from the gRPC project does the same over reflection:

Terminal window
grpc_cli ls <target>:50051
grpc_cli ls <target>:50051 <package.Service> -l

Invoke a method

Terminal window
grpcurl -plaintext -d '{"field": "value"}' <target>:50051 <package.Service>/<Method>

Try calling methods with empty or minimal input first to see which respond without authentication — an unauthenticated response to a sensitive method is a finding.

When reflection is disabled

If list returns an error, reflection is off and you need the interface definitions. Point grpcurl at the .proto files (from source, a leaked artifact, or a mobile/desktop client bundle) instead:

Terminal window
grpcurl -plaintext -proto <service.proto> -d '{}' <target>:50051 <package.Service>/<Method>

For TLS-protected services, drop -plaintext. Log every open port 50051, whether it’s plaintext, whether reflection is enabled, and every method you can invoke without auth, so the evidence lands in the pentest report instead of a scratch terminal you’ll lose.

What to Look For

Checkpoint What it means
HTTP/2 service answering on 50051 Almost certainly a gRPC server — confirm with grpcurl
openssl s_client fails / resets Plaintext h2c, no TLS — traffic and tokens are sniffable
grpcurl list returns services Server reflection is on — full API surface enumerable without .proto
Method responds with no credential Unauthenticated invocation — direct access to service logic
Admin/internal method callable directly Broken authorization — controls the front end enforces are bypassed
Verbose error messages / stack traces in responses Information disclosure about internals and dependencies
gRPC library/build version behind current Check HTTP/2 Rapid Reset and codec DoS CVEs below

Known CVEs and Exploits

There is no single “port 50051” CVE, and it would be dishonest to pretend otherwise. The dominant risk on this port is design and configuration — no authentication, no TLS, and server reflection left enabled — not a patchable bug. That said, the gRPC stack has had a handful of real, verified network-facing CVEs worth checking against the exact implementation and version you find:

  • CVE-2023-44487 — the HTTP/2 “Rapid Reset” denial of service (CVSS 7.5). Rapidly opening and immediately cancelling (RST_STREAM) many HTTP/2 streams forces the server to do work for requests that are thrown away, exhausting resources. Because gRPC runs on HTTP/2, gRPC servers were among the affected stacks; google.golang.org/grpc fixed it in 1.56.3 / 1.57.1 / 1.58.3. Exploited in the wild in the record-breaking DDoS campaigns of August–October 2023.
  • CVE-2023-4785 — lack of error handling in the TCP server in gRPC (C++, Python, Ruby) on POSIX platforms from version 1.23 onward (CVSS 7.5). An attacker who opens a large number of connections can exhaust resources and cause a denial of service. gRPC Java and Go are not affected. Fixed in the 1.53.x+ patch releases.
  • CVE-2026-33186 — an authorization bypass in gRPC-Go before 1.79.3 (CVSS 9.1). The server routed requests whose HTTP/2 :path omitted the mandatory leading slash (e.g. Service/Method instead of /Service/Method), but authorization interceptors evaluated the raw, non-canonical path — so a malformed path could slip past deny rules. This is the “call the admin method directly” authorization flaw in CVE form.
  • CVE-2020-7768prototype pollution in the grpc (grpc-node) and @grpc/grpc-js packages via loadPackageDefinition (CVSS up to 9.8), affecting grpc < 1.24.4 and @grpc/grpc-js < 1.1.8. A genuine gRPC library flaw in the Node.js ecosystem.
  • CVE-2021-3121 — the “skippy peanut butter” missing index validation in GoGo Protobuf before 1.3.2 (CVSS 8.6). This is not a gRPC-core bug — it’s in a third-party Protocol Buffers codec — but gogo/protobuf was the message layer for a large number of Go gRPC services (and downstream products like HashiCorp Consul), which makes it the clearest example of the message-deserialization risk class that gRPC’s protobuf front end exposes.

The previous version of this page cited CVE-2019-1003083 as a “Jenkins plugin using gRPC.” That is wrong: CVE-2019-1003083 is a missing-permission-check / SSRF flaw in the Jenkins Gearman Plugin and has nothing to do with gRPC or port 50051. It has been removed. As always, verify every CVE against its NVD record and confirm the product matches the service before trusting it.

Note there is no reliable Metasploit or Nmap NSE module that “exploits gRPC” as such — the real work on 50051 is reflection-driven enumeration with grpcurl followed by manual, unauthenticated method calls, not firing a canned exploit.

Mitigation

  • Require authentication on every RPC. Enforce per-call credentials (mTLS client certs, or short-lived tokens validated in a server interceptor) and reject unauthenticated calls — don’t assume “internal only” means safe.
  • Enforce TLS; stop running plaintext h2c across untrusted paths. Terminate or pass through TLS on 443 at the edge, and use mTLS between services in the mesh.
  • Disable server reflection in production. Reflection is a development convenience; leaving it on hands an attacker your entire API. Ship it off, or gate it behind auth.
  • Apply authorization consistently. Check permissions inside each method (or a well-tested interceptor), not just at the gateway, so admin/internal methods can’t be called directly. Canonicalize the request path before authorizing (see CVE-2026-33186).
  • Keep the gRPC stack patched. Track the HTTP/2 Rapid Reset and codec DoS fixes for your specific implementation (grpc-go, grpc C++/Python/Ruby, grpc-node) and update the protobuf codec too.
  • Don’t expose 50051 to the internet. Firewall it to the services that need it, audit Kubernetes ingress and cloud security groups for accidental 0.0.0.0:50051, and front any external gRPC through an authenticated gateway — often an HTTP/JSON transcoder on a port like 8080 rather than raw gRPC on the edge.

Real-World Example

The canonical gRPC-on-50051 attack is a recon-to-access chain that needs no exploit at all. An attacker finds 50051 open, confirms plaintext h2c with openssl s_client, and runs grpcurl -plaintext <target>:50051 list. Because server reflection was left enabled, the server obligingly returns every service and method it hosts — the equivalent of handing over a full API spec. A describe on each service dumps the message schemas, and since no authentication was enforced, the attacker calls internal methods directly with grpcurl -d '{...}', reading or writing data the application never intended to expose. This is exactly the pattern behind reported gRPC misconfigurations giving full read/write access to internal service logic in fast-deployed Kubernetes microservices — the network was trusted, so auth and TLS were skipped, and reflection turned the API into an open book.

The matching named incident is HTTP/2 Rapid Reset (CVE-2023-44487): because gRPC servers speak HTTP/2, the same stream-cancellation flood that drove the record DDoS attacks of late 2023 against major cloud providers applied to unpatched gRPC endpoints, and the gRPC-Go maintainers shipped point releases specifically to mitigate it. Capture both the reflection findings and any version-based DoS exposure straight into your pentest reporting tool so nothing gets lost between the terminal and the write-up.

FAQ

What is port 50051 used for?

Port 50051 is the conventional default port for gRPC servers. gRPC is Google’s high-performance RPC framework that sends Protocol Buffers messages over HTTP/2, and it’s used heavily for internal, service-to-service communication in microservice and Kubernetes environments. The port isn’t IANA-assigned to gRPC — it became the default because gRPC’s official examples and tutorials all use 50051, so countless services ship listening on it.

How do I know if a service on 50051 is really gRPC?

Point grpcurl at it. grpcurl -plaintext <host>:50051 list will return the service list if it’s a gRPC server with reflection enabled; if reflection is off you’ll still get a gRPC-shaped error rather than a normal HTTP response. nmap -sV -p 50051 <host> typically identifies the underlying HTTP/2 endpoint, and openssl s_client -connect <host>:50051 tells you whether it’s TLS or plaintext h2c.

What is gRPC server reflection and why does it matter?

Server reflection is a gRPC service that lets clients query the server for its service, method, and message definitions at runtime — so tools like grpcurl can work without the .proto files. For an attacker that’s a jackpot: it exposes the entire API surface, much like an open Swagger/OpenAPI page. It’s meant for development and should be disabled in production.

Is gRPC on port 50051 encrypted by default?

No. TLS in gRPC is opt-in. Many internal deployments run cleartext HTTP/2 (“h2c”) on the assumption the network is trusted, which means requests, responses, and any credentials inside them can be sniffed. Always confirm with openssl s_client and treat a plaintext gRPC service on an untrusted path as a finding.

Does gRPC have authentication built in?

Not automatically. gRPC provides mechanisms (mTLS, per-call tokens, call credentials, interceptors), but a server accepts and executes any well-formed RPC unless the developer explicitly enforces auth. A great many internal gRPC services on 50051 accept unauthenticated calls, which is why direct, unauthenticated method invocation is such a common finding.

How do I secure or close port 50051?

Enforce authentication (mTLS or validated tokens) on every method, turn on TLS instead of plaintext h2c, disable server reflection in production, apply authorization consistently inside each method, keep the gRPC stack patched for HTTP/2 and codec DoS bugs, and firewall 50051 to only the services that need it. If nothing legitimate should reach it from outside the cluster, block it at the ingress and security group and rescan to confirm.

TL;DR

  • Service: gRPC servers (grpc-go, grpc-java, gRPC C++, Python, grpc-node) — Protocol Buffers RPC over HTTP/2; 50051 is the tutorial/default port
  • Default port: 50051/TCP (HTTP/2)
  • Biggest risk: gRPC deployed with no authentication and no TLS (plaintext h2c), plus server reflection left enabled — letting an attacker enumerate every method and call internal/admin RPCs directly, unauthenticated
  • Mitigation: enforce mTLS/token auth on every RPC, require TLS, disable reflection in production, apply authorization consistently, patch the HTTP/2 stack (Rapid Reset), and firewall 50051 off the public internet