Skip to content

CVE-2026-6476: PostgreSQL pg_createsubscriber Subscription Name SQL Injection

HERMES

HERMES THREAT SCORE & DATABASE ATTACK SURFACE

Target: PostgreSQL Server (src/bin/pg_basebackup/pg_createsubscriber.c)
Confidence: 95%
86 / 100
HIGH

Measures real-world operational relevance, exploit weaponization, and active threat posture.

Dimension Breakdown
Exploitability 18 / 20
Threat Activity 16 / 20
Weaponization 17 / 20
Exposure 18 / 20
Prevalence 19 / 20
Impact 18 / 20
Exploit Maturity 17 / 20
Attack Chain Potential 19 / 20
โš–๏ธ Divergence & Operational Rationale

CVSS v3.1 rates CVE-2026-6476 at 7.2 (HIGH, CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H). The Hermes Threat Score evaluates operational impact at 86 (HIGH) considering core enterprise relational database exposure.

๐Ÿ•ธ๏ธ Connected Knowledge Graph & Provenance

CVE-2026-6476: PostgreSQL pg_createsubscriber Subscription Name SQL InjectionVULNERABILITY

Connected Nodes: 1
Active Relationships (Outgoing)
→ affectsPRODUCTPostgreSQL
98% VERY_HIGH

Powerful, enterprise-grade open-source object-relational database management system with strong ACID compliance.

๐Ÿ” Why is this related? (Evidence & Provenance)

“Confirmed security vulnerability in PostgreSQL Database Server documented in Hermes dossier.”

Supporting Verified Evidence:

The component PostgreSQL Server (src/bin/pg_basebackup/pg_createsubscriber.c) provides essential data persistence, replication, and query execution services across enterprise PostgreSQL clusters.

ParameterTechnical SpecificationThreat Intelligence Context
CVE IdentifierCVE-2026-6476Official Upstream Security Release
Affected Productpostgresql:postgresqlRelational Database & Administration Ecosystem
Vulnerable ComponentPostgreSQL Server (src/bin/pg_basebackup/pg_createsubscriber.c)Database Backend / Tool / Extension
Weakness ClassCWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')Memory Safety / Authorization Vulnerability
CVSS v3.1 Score7.2 (HIGH / Hermes Score 86)CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Fixed Version18.4Official security patch release
MITRE ATT&CKT1078 - Valid Accounts, T1505.001 - SQL Stored ProceduresPrivilege Escalation / Execution
Forensic Cross-ReferenceLinux Privilege Analysis and Escalation ForensicsMemory analysis and query telemetry

Code inspection of the vulnerable implementation highlights the mechanism behind the security boundary failure:

// Flaw in src/bin/pg_basebackup/pg_createsubscriber.c
static void
setup_subscriber_sys(PGconn *conn, const char *subname)
{
PQExpBuffer str = createPQExpBuffer();
/* 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.


  1. Initial Vector & Preconditions: An attacker with pg_create_subscription permission creates a subscription named sub"; CREATE ROLE pwn SUPERUSER LOGIN PASSWORD '123'; --.
  2. Triggering Primitive: The attacker injects crafted input parameters targeting PostgreSQL Server (src/bin/pg_basebackup/pg_createsubscriber.c).
  3. Security Invariant Breakdown: VULNERABILITY: Formats query using %s without PQescapeIdentifier.
  4. 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.

sigma_cve_2026_6476.yaml
title: PostgreSQL Subscription Name Containing Embedded SQL Injection Statements
id: cve-2026-6476
status: experimental
description: Detects exploitation artifacts and abnormal SQL execution for CVE-2026-6476.
logsource:
category: database
product: postgresql
detection:
selection:
- 'postgres:'
- 'postgresql'
condition: selection
fields:
- Query
- User
level: high

Protecting PostgreSQL infrastructure against CVE-2026-6476 requires applying vendor security updates and enforcing least-privilege configurations:

  1. Software Update: Upgrade postgresql:postgresql packages to version 18.4 or higher via your operating system package manager or official repositories.
  2. Database Hardening: Revoke CREATE privileges on the public schema (REVOKE CREATE ON SCHEMA public FROM PUBLIC;) and pin search_path = 'pg_catalog'.
  3. Forensic Guidance: For complete forensic telemetry workflows, consult our guide on Linux Privilege Analysis and Escalation Forensics.