The component PostgreSQL Server (src/bin/pg_basebackup/pg_createsubscriber.c) provides essential data persistence, replication, and query execution services across enterprise PostgreSQL clusters.
Parameter
Technical Specification
Threat Intelligence Context
CVE Identifier
CVE-2026-6476
Official Upstream Security Release
Affected Product
postgresql:postgresql
Relational Database & Administration Ecosystem
Vulnerable Component
PostgreSQL Server (src/bin/pg_basebackup/pg_createsubscriber.c)
Database Backend / Tool / Extension
Weakness Class
CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
/* VULNERABILITY: Formats query using %s without PQescapeIdentifier */
appendPQExpBuffer(str,
"ALTER SUBSCRIPTION %s ENABLE;",
subname); // Injects arbitrary SQL into superuser session!
PQexec(conn, str->data);
destroyPQExpBuffer(str);
}
When unvetted user input reaches this routine, the database engine miscalculates buffer capacity, bypasses execution sandboxes, or interprets untrusted identifiers as executable SQL syntax.
Initial Vector & Preconditions: An attacker with pg_create_subscription permission creates a subscription named sub"; CREATE ROLE pwn SUPERUSER LOGIN PASSWORD '123'; --.
Triggering Primitive: The attacker injects crafted input parameters targeting PostgreSQL Server (src/bin/pg_basebackup/pg_createsubscriber.c).
Security Invariant Breakdown: VULNERABILITY: Formats query using %s without PQescapeIdentifier.
Impact Realization: The payload executes, instantly granting superuser status to the attacker..
Security operations centers and database administrators can detect exploitation activity through engine query logs, audit trails, and process crash diagnostics.
Database & Process Telemetry
Inspect PostgreSQL server logs (/var/log/postgresql/) for messages matching:
postgres: [statement] CREATE ROLE pwn SUPERUSER LOGIN ... executed by pg_createsubscriber. Monitor for abnormal query aborts or sudden backend terminations.