Summary
The CloudNativePG instance manager exposes an HTTP status server on TCP port 8000 (url.StatusPort) on every PostgreSQL pod. By design, the security boundary for this listener is network isolation: it hosts the kubelet probe endpoints alongside a set of operator-only control endpoints (/pg/mode/backup, /update, /pg/archive/partial, /pg/controldata), and deployments are expected to restrict access to it with a NetworkPolicy. The control endpoints did not perform in-process authentication of the caller, and even with status-port-tls enabled the server authenticated itself to the client without requesting or verifying a client certificate.
Where the status port is not restricted at the network layer, any party able to reach TCP/8000 of an instance pod could therefore invoke these endpoints without credentials. The realistic impact is a bounded denial of service (disruption of the operator's backup orchestration, transient WAL retention, checkpoint I/O, transient ephemeral-storage pressure) and disclosure of operational metadata (replication/WAL state, system identifier, pg_controldata). It is not remote code execution, secret disclosure, or unbounded WAL exhaustion.
Resolution
Starting with 1.30.0 (#10579), CloudNativePG no longer relies solely on network isolation for these endpoints and adds in-process authentication of the operator as a defense-in-depth layer. The operator generates an in-memory ECDSA P-256 client certificate at startup and publishes its SHA-256 public-key fingerprint in the cluster's .status.operatorCertificateFingerprint. The instance manager pins that fingerprint and rejects any call to the sensitive endpoints (/pg/mode/backup, /update, /pg/archive/partial, /pg/controldata) that does not present a certificate with the matching public key. Probe endpoints (/healthz, /readyz, /startupz, /failsafe) and /pg/status remain unauthenticated by design (see Information disclosure below).
This is a hardening enhancement and is not backported; earlier releases should continue to rely on the network-level mitigation below.
Details
The control endpoints (pkg/management/postgres/webserver/remote.go) were wired onto the same mux as the probes with no per-request authentication, and the TLS branch set only GetCertificate (no ClientAuth, no ClientCAs). The following corrections apply to the impact as originally reported:
1. Backup control is single-flight and self-cleaning — not an unbounded-WAL DoS. /pg/mode/backup is serialized by the ongoingBackupRequest mutex, and the server keeps a single currentBackup. Each POST closes the previous backup connection before opening a new one, and the replication slot is created temporary => true, so PostgreSQL drops it when that connection closes. A background routine (cleanupStaleCollections, every ~60s) additionally closes any backup whose corresponding Backup resource does not exist — which is always the case for an attacker-chosen name. Consequently at most one temporary slot exists at any time, and an orphaned one is reaped within ~1 minute; the "open an unbounded number of sessions / many slots pinning WAL until pg_wal fills" scenario does not occur. The residual availability impact is bounded WAL retention (~1 minute), forced-checkpoint I/O from repeated immediateCheckpoint calls, and disruption of the operator's own in-flight backups.
2. /pg/status does not return the Pod object. Server-side, instance.GetStatus() populates Pod with the pod name only (&corev1.Pod{ObjectMeta: {Name: ...}}). The full corev1.Pod is assembled client-side by the operator and the kubectl cnpg plugin (AddPod), each of which already holds RBAC to read it; it never transits the endpoint. The unauthenticated disclosure is therefore limited to operational metadata: replication/WAL state, slot info, system identifier, instance-manager version, and (via /pg/controldata) pg_controldata output. No secrets, credentials, or Pod spec are exposed. /pg/status remains intentionally unauthenticated because it backs the Kubernetes API server ProxyGet path used by kubectl cnpg status.
3. /update is hash-pinned — no code execution. The upgrade handler accepts a streamed binary only if its SHA-256 matches the value already published by the operator in cluster.status.availableArchitectures[].hash (pkg/management/upgrade/upgrade.go). An attacker cannot install an arbitrary binary; the only residual is transient ephemeral-storage consumption, since the body is streamed to /controller before the hash is validated at the end. The handler is also serialized by InstanceManagerIsUpgrading.
4. /pg/archive/partial only acts when the instance is fenced and is the cluster's current/target primary.
Impact
- Vulnerability class: Missing authentication for a privileged function (CWE-306).
- Primary impact: Bounded denial of service — disruption of operator-driven backups, ~1-minute WAL retention, forced-checkpoint I/O, and transient ephemeral-storage pressure on the controller volume. No persistent WAL exhaustion.
- Secondary impact: Unauthenticated disclosure of operational metadata (replication/WAL state, system identifier,
pg_controldata). No Pod object, secrets, or credentials.
- Not impacted: No remote code execution (
/update is SHA-256 pinned). No PostgreSQL credential or secret disclosure.
- Privileges required: Network reachability to TCP/8000 of an instance pod; no authentication, Kubernetes RBAC, or PostgreSQL credentials.
Mitigations (for versions < 1.30.0)
Restrict the instance status port (TCP/8000) with a Kubernetes NetworkPolicy so that only the operator can reach it, and upgrade to 1.30.0, which authenticates the operator to the instance manager.
Summary
The CloudNativePG instance manager exposes an HTTP status server on TCP port
8000(url.StatusPort) on every PostgreSQL pod. By design, the security boundary for this listener is network isolation: it hosts the kubelet probe endpoints alongside a set of operator-only control endpoints (/pg/mode/backup,/update,/pg/archive/partial,/pg/controldata), and deployments are expected to restrict access to it with a NetworkPolicy. The control endpoints did not perform in-process authentication of the caller, and even withstatus-port-tlsenabled the server authenticated itself to the client without requesting or verifying a client certificate.Where the status port is not restricted at the network layer, any party able to reach TCP/8000 of an instance pod could therefore invoke these endpoints without credentials. The realistic impact is a bounded denial of service (disruption of the operator's backup orchestration, transient WAL retention, checkpoint I/O, transient ephemeral-storage pressure) and disclosure of operational metadata (replication/WAL state, system identifier,
pg_controldata). It is not remote code execution, secret disclosure, or unbounded WAL exhaustion.Resolution
Starting with 1.30.0 (#10579), CloudNativePG no longer relies solely on network isolation for these endpoints and adds in-process authentication of the operator as a defense-in-depth layer. The operator generates an in-memory ECDSA P-256 client certificate at startup and publishes its SHA-256 public-key fingerprint in the cluster's
.status.operatorCertificateFingerprint. The instance manager pins that fingerprint and rejects any call to the sensitive endpoints (/pg/mode/backup,/update,/pg/archive/partial,/pg/controldata) that does not present a certificate with the matching public key. Probe endpoints (/healthz,/readyz,/startupz,/failsafe) and/pg/statusremain unauthenticated by design (see Information disclosure below).This is a hardening enhancement and is not backported; earlier releases should continue to rely on the network-level mitigation below.
Details
The control endpoints (
pkg/management/postgres/webserver/remote.go) were wired onto the same mux as the probes with no per-request authentication, and the TLS branch set onlyGetCertificate(noClientAuth, noClientCAs). The following corrections apply to the impact as originally reported:1. Backup control is single-flight and self-cleaning — not an unbounded-WAL DoS.
/pg/mode/backupis serialized by theongoingBackupRequestmutex, and the server keeps a singlecurrentBackup. EachPOSTcloses the previous backup connection before opening a new one, and the replication slot is createdtemporary => true, so PostgreSQL drops it when that connection closes. A background routine (cleanupStaleCollections, every ~60s) additionally closes any backup whose correspondingBackupresource does not exist — which is always the case for an attacker-chosen name. Consequently at most one temporary slot exists at any time, and an orphaned one is reaped within ~1 minute; the "open an unbounded number of sessions / many slots pinning WAL untilpg_walfills" scenario does not occur. The residual availability impact is bounded WAL retention (~1 minute), forced-checkpoint I/O from repeatedimmediateCheckpointcalls, and disruption of the operator's own in-flight backups.2.
/pg/statusdoes not return the Pod object. Server-side,instance.GetStatus()populatesPodwith the pod name only (&corev1.Pod{ObjectMeta: {Name: ...}}). The fullcorev1.Podis assembled client-side by the operator and thekubectl cnpgplugin (AddPod), each of which already holds RBAC to read it; it never transits the endpoint. The unauthenticated disclosure is therefore limited to operational metadata: replication/WAL state, slot info, system identifier, instance-manager version, and (via/pg/controldata)pg_controldataoutput. No secrets, credentials, or Pod spec are exposed./pg/statusremains intentionally unauthenticated because it backs the Kubernetes API serverProxyGetpath used bykubectl cnpg status.3.
/updateis hash-pinned — no code execution. The upgrade handler accepts a streamed binary only if its SHA-256 matches the value already published by the operator incluster.status.availableArchitectures[].hash(pkg/management/upgrade/upgrade.go). An attacker cannot install an arbitrary binary; the only residual is transient ephemeral-storage consumption, since the body is streamed to/controllerbefore the hash is validated at the end. The handler is also serialized byInstanceManagerIsUpgrading.4.
/pg/archive/partialonly acts when the instance is fenced and is the cluster's current/target primary.Impact
pg_controldata). No Pod object, secrets, or credentials./updateis SHA-256 pinned). No PostgreSQL credential or secret disclosure.Mitigations (for versions < 1.30.0)
Restrict the instance status port (TCP/8000) with a Kubernetes NetworkPolicy so that only the operator can reach it, and upgrade to 1.30.0, which authenticates the operator to the instance manager.