# CVE-2026-44477: CloudNativePG: Metrics exporter allows privilege escalation to PostgreSQL superuser and OS RCE

> Attackers can escalate privileges to PostgreSQL superuser and execute OS commands by exploiting improper role demotion in the metrics exporter.

- **Severity:** Critical 9.4 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 28 May 2026
- **Updated:** 15 Jul 2026
- **Also known as:** GHSA-423p-g724-fr39, GO-2026-5106, MINI-65wx-h36c-mf6j, MINI-8qcj-4fpw-qhjq, MINI-c7rg-37g5-6hq2, MINI-cxq5-2g7f-hfcc, MINI-fq8r-33gp-pv46, MINI-r224-wchp-j6x9, MINI-wcfh-f5m7-w855

## What is CVE-2026-44477?

CVE-2026-44477 is a critical vulnerability in cloudnative-pg, published on 28 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

CloudNativePG is a platform designed to manage PostgreSQL databases within Kubernetes environments. Prior to 1.29.1 and 1.28.3, the CloudNativePG metrics exporter opens its PostgreSQL connection as the postgres superuser via the pod-local Unix socket, then demotes the session with SET ROLE pg_monitor. SET ROLE changes only current_user; session_user remains postgres. Any SQL expression evaluated inside the scrape session can invoke RESET ROLE to recover real superuser privileges, then use COPY ... TO PROGRAM to spawn an OS-level subprocess as the postgres user inside the primary pod. The READ ONLY transaction flag does not block this; it gates writes to database state, not external processes. This vulnerability is fixed in 1.29.1 and 1.28.3.

Weakness: CWE-426 (Untrusted Search Path), CWE-271 (Privilege Dropping / Lowering Errors), CWE-250 (Execution with Unnecessary Privileges)

## Which versions are affected by CVE-2026-44477?

5 open source packages ship an affected version, including github.com/cloudnative-pg/cloudnative-pg. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/cloudnative-pg/cloudnative-pg` | Go | All versions | 1.28.3, 1.29.1 |
| `github.com/cloudnative-pg/cloudnative-pg` | Go | All versions | 1.28.3 |
| `github.com/cloudnative-pg/cloudnative-pg` | Go | All versions | 1.28.3 |
| `github.com/cloudnative-pg/cloudnative-pg` | Go | From 1.29.0 | 1.29.1 |
| `github.com/cloudnative-pg/cloudnative-pg` | Go | From 1.29.0 | 1.29.1 |

Products: Linuxfoundation Cloudnativepg.

## How do I fix CVE-2026-44477?

Upgrade github.com/cloudnative-pg/cloudnative-pg to a fixed version for your release line: 1.28.3 or 1.29.1.

## Is CVE-2026-44477 being exploited?

There is no known exploitation of CVE-2026-44477 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-44477 and fix it if it is affected.

What it is: CVE-2026-44477 is a critical vulnerability in cloudnative-pg, published on 28 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-44477 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/cloudnative-pg/cloudnative-pg (Go): affected all versions; fixed in 1.28.3, 1.29.1
- github.com/cloudnative-pg/cloudnative-pg (Go): affected all versions; fixed in 1.28.3
- github.com/cloudnative-pg/cloudnative-pg (Go): affected all versions; fixed in 1.28.3
- github.com/cloudnative-pg/cloudnative-pg (Go): affected from 1.29.0; fixed in 1.29.1
- github.com/cloudnative-pg/cloudnative-pg (Go): affected from 1.29.0; fixed in 1.29.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-44477/ (Markdown: https://insights.sbomify.com/CVE-2026-44477/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-44477
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-44477
- OSV: https://osv.dev/vulnerability/CVE-2026-44477

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-44477/
Summaries are generated and may contain mistakes; the official description above is the record.
