<?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>Postgrex — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/postgrex/</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, 18 May 2026 17:53:57 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/postgrex/feed.xml" rel="self" type="application/rss+xml"/><item><title>Postgrex SQL Injection Vulnerability in Notifications.listen/3 (CVE-2026-32687)</title><link>https://feed.craftedsignal.io/briefs/2026-05-postgrex-sqli/</link><pubDate>Mon, 18 May 2026 17:53:57 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-05-postgrex-sqli/</guid><description>A SQL injection vulnerability exists in Postgrex versions 0.16.0 to before 0.22.2 within the `Postgrex.Notifications.listen/3` function allowing attackers to execute arbitrary SQL commands on the notifications connection by manipulating the channel name.</description><content:encoded><![CDATA[<p>A SQL injection vulnerability has been identified in the Postgrex library, specifically affecting versions 0.16.0 up to 0.22.2. The vulnerability resides in the <code>Postgrex.Notifications.listen/3</code> function. The <code>channel</code> argument is directly interpolated into the <code>LISTEN</code> and <code>UNLISTEN</code> SQL commands without proper sanitization, creating an opportunity for attackers to inject arbitrary SQL. This issue could be exploited by any caller who uses a user-influenced channel name without input validation. Successful exploitation could lead to unauthorized data access, modification, or even destruction within the PostgreSQL database. The vulnerability is identified as CVE-2026-32687.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a malicious channel name containing SQL injection payloads.</li>
<li>The application calls <code>Postgrex.Notifications.listen/3</code> or <code>Postgrex.Notifications.unlisten/3</code> with the malicious channel name.</li>
<li>Postgrex interpolates the unsanitized channel name into a <code>LISTEN</code> or <code>UNLISTEN</code> SQL command.</li>
<li>The injected SQL command is executed on the notifications connection.</li>
<li>The attacker can execute arbitrary SQL commands, such as creating tables, dropping tables, or creating roles.</li>
<li>This can lead to privilege escalation within the database.</li>
<li>Sensitive data can be accessed, modified, or deleted.</li>
<li>The attacker gains control over the application&rsquo;s database.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this SQL injection vulnerability (CVE-2026-32687) can allow attackers to execute arbitrary SQL commands on the database, potentially leading to unauthorized data access, modification, or destruction. Since the notifications connection runs as the application&rsquo;s database role, the attacker can read, modify, or destroy any data that the application&rsquo;s DB role has access to. This could have a severe impact on the application&rsquo;s functionality and data integrity.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to Postgrex version 0.22.2 or later to patch the vulnerability.</li>
<li>Sanitize user input used as channel names in <code>Postgrex.Notifications.listen/3</code> and <code>Postgrex.Notifications.unlisten/3</code> by ensuring it does not contain quotes or null bytes, as recommended in the advisory.</li>
<li>Deploy the Sigma rules provided below to detect potential exploitation attempts in your environment.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">threat</category><category>sql-injection</category><category>vulnerability</category><category>postgrex</category></item></channel></rss>