Skip to content

Instance manager status-server control endpoints relied on network isolation rather than operator authentication

Moderate
mnencia published GHSA-7qwx-x8ff-3px9 Jun 29, 2026

Software

ghcr.io/cloudnative-pg/cloudnative-pg

Affected versions

< 1.30.0

Patched versions

1.30.0

Description

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.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Adjacent
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
Low

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L

CVE ID

No known CVE

Weaknesses

Missing Authentication for Critical Functionality

The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources. Learn more on MITRE.

Credits