<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>CloudNativePG &gt;= 1.29.0, &lt; 1.29.1 — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/cloudnativepg--1.29.0--1.29.1/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Mon, 11 May 2026 16:01:46 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/cloudnativepg--1.29.0--1.29.1/feed.xml" rel="self" type="application/rss+xml"/><item><title>CloudNativePG Metrics Exporter Privilege Escalation and RCE (CVE-2026-44477)</title><link>https://feed.craftedsignal.io/briefs/2026-05-cnpg-privesc/</link><pubDate>Mon, 11 May 2026 16:01:46 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-cnpg-privesc/</guid><description>CVE-2026-44477 allows a low-privileged database user to escalate to PostgreSQL superuser and achieve OS command execution as the `postgres` user within the primary pod by exploiting the metrics exporter's superuser connection via custom metric queries or the default configuration.</description><content:encoded><![CDATA[<p>A critical vulnerability, CVE-2026-44477, exists in the CloudNativePG metrics exporter that allows a low-privileged database user to gain PostgreSQL superuser privileges and execute arbitrary OS commands as the <code>postgres</code> user inside the primary pod. This is due to the exporter initially connecting to PostgreSQL as the <code>postgres</code> superuser and then demoting privileges using <code>SET ROLE pg_monitor</code>, while retaining the superuser identity in the session. This vulnerability affects deployments using custom metric queries with unqualified identifiers and deployments with default monitoring enabled. The attacker can leverage <code>RESET ROLE</code> to recover superuser privileges and then use <code>COPY ... TO PROGRAM</code> to execute OS-level subprocesses. Multi-tenant platforms that allow customers to influence custom metric queries are at the highest risk. Patches addressing this vulnerability have been released in versions 1.29.1 and 1.28.3 and later.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker gains access to a low-privileged database role (e.g., the default <code>app</code> role).</li>
<li>The attacker identifies a target database being scraped by the CloudNativePG metrics exporter.</li>
<li>(Path 1: Custom Metric Queries) The attacker plants a shadow object (e.g., function, view) in a schema on the <code>search_path</code> of the target database, with the same name as an unqualified identifier used in a custom metric query.</li>
<li>(Path 2: Default Monitoring) The attacker plants a shadow object named <code>current_database()</code> in a user database, exploiting the unqualified call in the <code>pg_extensions</code> metric.</li>
<li>When the metrics exporter next scrapes the database, the shadow object&rsquo;s code is executed within the exporter&rsquo;s <code>session_user = postgres</code> session.</li>
<li>The attacker&rsquo;s code executes <code>RESET ROLE</code> to recover superuser privileges within the scrape session.</li>
<li>The attacker&rsquo;s code then uses <code>COPY ... TO PROGRAM</code> to execute an arbitrary OS command as the <code>postgres</code> user inside the primary pod.</li>
<li>The attacker achieves arbitrary OS command execution inside the database pod, potentially leading to further lateral movement or data exfiltration.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows privilege escalation from a low-privileged database role to PostgreSQL superuser, combined with arbitrary OS command execution as the <code>postgres</code> user inside the primary pod. A web application SQL injection vulnerability in an app backed by a CloudNativePG cluster is sufficient to pivot to database-pod RCE. All deployments with default monitoring enabled or custom metric queries containing unqualified catalog references are affected. Multi-tenant platforms are at the highest risk.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade CloudNativePG to v1.28.3 or later, or v1.29.1 or later to incorporate the fixes described in the advisory, specifically addressing CVE-2026-44477.</li>
<li>Apply the workaround by schema-qualifying all identifiers in custom metric queries as described in the advisory, using explicit <code>pg_catalog.</code> prefixes.</li>
<li>Restrict database ownership to fully trusted roles, ensuring only these roles own user databases in scraped clusters to limit the exploit&rsquo;s impact, per the advisory recommendations.</li>
<li>Deploy the Sigma rule &ldquo;Detect CloudNativePG Postgres User Pod RCE&rdquo; to identify potential exploitation attempts leveraging the COPY command to program, based on process creation logs.</li>
<li>Deploy the Sigma rule &ldquo;Detect CloudNativePG Metrics Exporter PrivEsc via Shadowed current_database&rdquo; to detect the shadowing of current_database function.</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>privilege-escalation</category><category>remote-code-execution</category><category>CVE-2026-44477</category><category>CloudNativePG</category></item></channel></rss>