PostgreSQL Fixes 12-Year-Old Logical Decoding Flaw Enabling Replication-Role Code Execution

A 12-Year-Old Flaw in PostgreSQL Replication System Leaves Thousands Vulnerable to Remote Code Execution

Thousands of organizations using PostgreSQL, a popular open-source relational database management system, have been left vulnerable to remote code execution attacks due to a 12-year-old flaw in its replication system. The vulnerability, identified as CVE-2023-4651, was patched by the PostgreSQL developers last week, but it’s unclear how many systems remain exposed.

The issue lies in the Logical Decoding (LD) module, which is used to replicate transactions between databases in a cluster. LD allows for the extraction of database logs and replication of data between nodes. However, researchers discovered that an attacker with access to the replication stream could execute arbitrary code on any node in the cluster by exploiting a flawed handling of SQL commands. This means that an attacker could potentially gain unauthorized access to sensitive data or even take control of the entire system.

The vulnerability affects all versions of PostgreSQL from 9.4 to 14, which is approximately 90% of all PostgreSQL installations worldwide. The sheer number of affected systems and the ease with which attackers can exploit this flaw make it a significant concern for organizations that rely on PostgreSQL for their database management needs. Moreover, the fact that this vulnerability has been present in the system for over a decade highlights the importance of regular security updates and patching.

The exploitation of this vulnerability is relatively straightforward, requiring only access to the replication stream and basic SQL knowledge. This makes it an attractive option for attackers seeking to gain unauthorized access to sensitive data or disrupt database operations. PostgreSQL developers have provided guidance on how to apply the necessary patches, but many organizations may struggle to keep up with the updates due to the sheer complexity of their systems.

To mitigate this risk, organizations are advised to prioritize updating their PostgreSQL installations as soon as possible. This involves not only applying the latest security patch but also reviewing and hardening their replication configurations to prevent unauthorized access. Furthermore, regular backups and monitoring of database activity can help identify any potential breaches or anomalies in a timely manner.


Source: The Hacker News — 2026-09-04