etcd Exposed Without Authentication

The etcd database that holds the Kubernetes cluster's state accepts connections without client certificate authentication, exposing every Secret and object in the cluster.

SeverityCritical
CVSS 3.19.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Open in the calculator
CVSS 4.09.3 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Open in the calculator
CWECWE-306: Missing Authentication for Critical Function
OWASP Top 10A07:2025 Authentication Failures
MITRE ATT&CKT1133 External Remote Services, T1552.007 Container API
CategoryBroken Access Control

Description

etcd is the key-value store in which the Kubernetes API server keeps the entire state of the cluster, including every Secret, the definition of every workload and the cluster's access control rules. Kubernetes protects it with mutual TLS: etcd should accept client connections, by default on port 2379, only from clients presenting a certificate issued by its own certificate authority, and treat peer connections between etcd members, on port 2380, in the same way.

The weakness arises when etcd listens on a reachable interface without client certificate authentication (--client-cert-auth with a trusted CA), or over plain HTTP, so that anyone who can connect can read and write its keys. An unauthenticated attacker who can reach it can read every Secret in the cluster, including application credentials, cloud keys and any long-lived service account tokens: Kubernetes stores its objects under the /registry prefix, and Secrets are not encrypted in etcd unless encryption at rest has been configured on the API server.

The attacker can also change the cluster's stored state directly, for example to grant themselves administrative rights, bypassing the API server's authentication, authorisation and admission controls entirely. This amounts to full control of the cluster, and often of the cloud and infrastructure accounts whose credentials it holds.

The weakness can be confirmed by connecting with etcdctl without a client certificate, for example listing keys with etcdctl get /registry --prefix --keys-only, or by requesting the /version endpoint. Network scanners identify the service on its default ports.

Remediation

  • Require client certificate authentication on etcd: set --client-cert-auth=true with --trusted-ca-file, serve TLS with --cert-file and --key-file, and protect peer traffic in the same way with --peer-client-cert-auth=true, --peer-trusted-ca-file, --peer-cert-file and --peer-key-file.
  • Use a certificate authority dedicated to etcd, and give the API server its own client certificate through --etcd-cafile, --etcd-certfile and --etcd-keyfile.
  • Bind etcd only to the interfaces it needs, and allow ports 2379 and 2380 only from the API servers and the other etcd members with a host or network firewall.
  • Configure encryption at rest for Secrets on the API server, and protect etcd backups and snapshots as carefully as etcd itself.
  • If etcd has been reachable by untrusted parties, treat every Secret in the cluster as compromised and rotate it.

Confirm the fix by repeating the unauthenticated etcdctl connection from outside the control plane and checking that it is refused.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Containers and Kubernetes Findings

Every Containers and Kubernetes finding