/

CVE-2026-55765

Severity:

HIGH RISK

(8.5)

Cleartext Passwords (CWE-256) in CloudNativePG Roles

CVE-2026-55765

Deferred

Vulnerability type

Category:

Cleartext Credential Exposure

CWE:

CWE-256, CWE-522

Impact:

Credential Disclosure and Remote Code Execution

Severity:

HIGH RISK

(8.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

CloudNativePG generated PostgreSQL role-management statements containing cleartext passwords, allowing sensitive credentials to be recorded by pg_stat_statements under certain monitoring configurations. An untrusted tenant with pg_monitor or pg_read_all_stats access could recover managed passwords and, where superuser TCP access was enabled, use them to execute operating system commands in the database pod.

Affected context

The issue occurs in CloudNativePG clusters where platform-managed passwords are applied through generated ALTER ROLE or CREATE ROLE statements, pg_stat_statements is preloaded with track_utility enabled, and an untrusted tenant has access to statistics views through pg_monitor or pg_read_all_stats. Clusters using SCRAM-SHA-256 verifiers in managed-role Secrets are not affected by this exposure path.

Exploit preconditions

  • Attack surface: PostgreSQL statistics and role-management activity within a CloudNativePG-managed cluster
  • Required access: An untrusted tenant must hold pg_monitor or pg_read_all_stats privileges
  • Trigger point: A managed role password is set or changed while pg_stat_statements tracks utility statements
  • Why exploitation is possible: Generated SQL includes the cleartext password, which may be retained in query statistics and exposed to authorized statistics readers
  • Additional condition for command execution: Recovered credentials must permit a connection with sufficient database privileges, and superuser TCP access must be enabled

Why this happens

The underlying bug is the inclusion of cleartext credentials in SQL statements generated for role management. When utility statements are tracked, these credentials can become observable through PostgreSQL statement statistics to principals that were not intended to receive the password.

This behavior maps primarily to CWE-256: Plaintext Storage of a Password, because a secret is exposed in a recoverable cleartext form, and secondarily to CWE-522: Insufficiently Protected Credentials, because access to monitoring data can disclose credentials with elevated privileges.

Potential impact

  • Managed superuser or application-owner passwords could be disclosed.
  • An attacker could authenticate to PostgreSQL using recovered credentials.
  • Database contents and configuration could be accessed or modified.
  • An attacker could execute operating system commands in the database pod where database privileges and server configuration permit it.
  • The database pod or surrounding Kubernetes environment could be compromised.

General mitigation guidance

Mitigation generally focuses on preventing secrets from appearing in observable SQL text and reducing the privileges that can view database telemetry.

Common defensive patterns include:

  • Applying role passwords through mechanisms that do not place cleartext credentials in tracked SQL statements.
  • Using verifier-based secret handling, such as SCRAM-SHA-256 verifiers, where compatible with the deployment.
  • Restricting pg_monitor and pg_read_all_stats privileges to trusted operators and services.
  • Disabling or tightly controlling utility-statement tracking when it is not required.
  • Limiting superuser network access and avoiding unnecessary database-to-operating-system execution capabilities.
  • Running database pods with least-privilege identities, restricted capabilities, and strong network policies.
  • Rotating credentials that may have been exposed through statement statistics or related telemetry.

How teams detect issues like this

Detection can combine configuration review, telemetry inspection, and source analysis:

  • Search PostgreSQL statistics data and exported observability systems for role-management statements containing password material.
  • Review whether pg_stat_statements is preloaded with track_utility enabled in clusters containing sensitive managed roles.
  • Audit membership in pg_monitor and pg_read_all_stats, especially for tenant-facing roles.
  • Inspect application and controller code for string construction that embeds secrets in ALTER ROLE or CREATE ROLE statements.
  • Use static-analysis rules and code-review checks to flag credentials interpolated into SQL, logging, metrics, or tracing paths.
  • Enforce policies that prevent sensitive values from appearing in query text and restrict superuser TCP access.

Sources

SourceLink
github.comgithub.com/cloudnative-pg/cloudnative-pg/commit/2f0342747e1f160425b9d51753c0069b0d6117d5
github.comgithub.com/cloudnative-pg/cloudnative-pg/commit/3cd5af5d388c26758acf13c19ea806b4bcebb3fe
github.comgithub.com/cloudnative-pg/cloudnative-pg/commit/9a13573dbe3d78721b7ea92141e6d2324a2c0ef0
github.comgithub.com/cloudnative-pg/cloudnative-pg/pull/10724
github.comgithub.com/cloudnative-pg/cloudnative-pg/releases/tag/v1.28.4
github.comgithub.com/cloudnative-pg/cloudnative-pg/releases/tag/v1.29.2
github.comgithub.com/cloudnative-pg/cloudnative-pg/releases/tag/v1.30.0
github.comgithub.com/cloudnative-pg/cloudnative-pg/security/advisories/GHSA-w3gf-xc94-wvmj

Frequently asked

questions

Exploitation generally requires an untrusted tenant to have pg_monitor or pg_read_all_stats access, along with a cluster configuration that records utility statements containing role passwords.

No. Operating system command execution additionally depends on recovering credentials with sufficient database privileges, enabled superuser TCP connectivity, and database configuration that permits command execution through PostgreSQL functionality.

Prevent cleartext passwords from entering SQL statements or telemetry, use verifier-based secret handling where appropriate, and restrict access to database statistics and administrative roles.

Treat credentials as non-loggable data, review SQL and observability paths for secret exposure, minimize monitoring privileges, and apply least privilege to both PostgreSQL roles and database workloads.

Find out what's already
exploitable in your codebase.