The PostgreSQL Global Development Group has released critical security updates addressing a 12-year-old vulnerability that permits accounts carrying database replication privileges to execute arbitrary operating-system commands on the underlying database server.
The vulnerability, tracked as CVE-2026-6471 (CVSS 7.2) and named PostGREShell by researchers at data security firm Cyera Research, affects all versions of PostgreSQL released since 2014 (PostgreSQL 9.4 through 18.5, 17.10, 16.14, 15.18, and 14.23).
Vulnerability Roots in Logical Decoding
When PostgreSQL introduced logical decoding in version 9.4, it allowed external consumers—such as change data capture (CDC) systems, read-replicas, and audit pipelines—to stream database write-ahead logs (WAL) in structured formats. Setting up a replication stream requires invoking the SQL command CREATE_REPLICATION_SLOT with a specified output plugin.
Cyera researcher Vladimir Tokarev discovered that PostgreSQL passed the user-supplied plugin parameter directly into system dynamic library loading functions (such as dlopen()) without validating whether the library resided within trusted system paths.
If an attacker possesses credentials for an account with the REPLICATION attribute—a privilege routinely granted to automated backup utilities, Debezium connectors, and monitoring microservices—they could stage a malicious shared library (.so) on disk or over an accessible network mount and instruct PostgreSQL to load and execute it.
"Because replication users are often considered service accounts rather than full superusers, organizations routinely permit broader access. PostGREShell collapsed that distinction, turning replication rights into host root."
The Fix: Plugin Whitelisting
To neutralize the flaw without breaking production replication topologies, PostgreSQL introduced a new global configuration parameter in updated releases: output_plugin_libraries.
By default, the parameter restricts loaded plugins to built-in handlers: 'pgoutput, test_decoding'. Any attempt to initialize a replication slot referencing a plugin not explicitly listed in output_plugin_libraries is rejected with an authorization error.
Deployment & Change-Management Warning
Database administrators planning this patch cycle must heed a critical operational warning:
- Audit CDC & Kafka Connectors: If your environment utilizes third-party logical decoding plugins—such as
wal2jsonordecoderbufs—upgrading PostgreSQL without modifyingpostgresql.confwill cause replication streams to fail immediately. - Update Configuration Before Reload: Append required plugin libraries to
output_plugin_librariesinpostgresql.confprior to applying the maintenance update and restarting the database daemon. - Audit REPLICATION Grants: Execute
SELECT rolname FROM pg_roles WHERE rolreplication = true;and remove replication attributes from all accounts that do not strictly require them for production sync.



