<Vulnerability name="CVE-2026-6467">
    <DocumentDistribution xml:lang="en">Copyright © 2012 Red Hat, Inc. All rights reserved.</DocumentDistribution>
    <ThreatSeverity>Important</ThreatSeverity>
    <PublicDate>2026-11-12T14:15:32</PublicDate>
    <Bugzilla id="2572538" url="https://bugzilla.redhat.com/show_bug.cgi?id=2572538" xml:lang="en:us">
postgresql: postgresql: Privilege escalation via uncontrolled search path in extension management
    </Bugzilla>
    <CVSS3 status="verified">
        <CVSS3BaseScore>7.2</CVSS3BaseScore>
        <CVSS3ScoringVector>CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H</CVSS3ScoringVector>
    </CVSS3>
    <CWE>CWE-427</CWE>
    <Details xml:lang="en:us" source="Mitre">
Uncontrolled search path element in PostgreSQL CREATE EXTENSION allows an attacker with database-level CREATE privilege to execute arbitrary code as the bootstrap superuser, via ALTER SCHEMA ... RENAME or CREATE EXTENSION ... SCHEMA "$user".  ALTER EXTENSION was also affected.  A trusted-extension script located the wrong object and executed arbitrary SQL of the attacker's choice.  Versions before PostgreSQL 18.7, 17.12, 16.16, 15.20, and 14.25 are affected.
    </Details>
    <Details xml:lang="en:us" source="Red Hat">
A flaw was found in PostgreSQL. An uncontrolled search path issue in extension management allows an authenticated user with database-level CREATE privileges to execute arbitrary code as the database superuser. By altering schemas or specifying crafted schema names during extension installation or modification, an attacker can cause trusted extension scripts to execute arbitrary SQL commands with elevated privileges.
    </Details>
    <Statement xml:lang="en:us">
This vulnerability is rated as an Important impact because an authenticated user possessing database creation rights can escalate privileges to the database bootstrap superuser, resulting in complete administrative control over the PostgreSQL instance. While the flaw demands pre-existing database credentials with database-level CREATE permissions, the resulting blast radius encompasses full compromise of database confidentiality, integrity, and availability. In standard Red Hat Enterprise Linux deployments, unprivileged users do not receive database-level CREATE permissions by default, limiting exposure to systems configured for non-superuser extension administration or delegated multi-tenant operations.
    </Statement>
    <Mitigation xml:lang="en:us">
Revoke database-level CREATE privileges from untrusted roles and restrict network access to the PostgreSQL service.

To prevent non-superusers from creating schemas or installing extensions, revoke the database creation privilege in PostgreSQL:

REVOKE CREATE ON DATABASE &lt;database_name&gt; FROM PUBLIC;
REVOKE CREATE ON DATABASE &lt;database_name&gt; FROM &lt;role_name&gt;;

Additionally, limit network exposure by restricting connections in pg_hba.conf to trusted hosts, or enforce firewall rules via firewalld:

firewall-cmd --permanent --zone=public --remove-service=postgresql
firewall-cmd --reload

If modifying pg_hba.conf, apply configuration changes using:

systemctl reload postgresql

Warning: Reloading the service or applying firewall rules will alter network connectivity and may disconnect clients that are not explicitly permitted. Revoking the CREATE privilege prevents affected accounts from defining new schemas or managing extensions until granted by a superuser.
    </Mitigation>
    <AffectedRelease cpe="cpe:/a:redhat:hummingbird:1">
        <ProductName>Red Hat Hardened Images</ProductName>
        <ReleaseDate>2026-11-13T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:100114">RHSA-2026:100114</Advisory>
        <Package name="postgresql17-main">postgresql17-main-17.12-0.1.hum1</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:hummingbird:1">
        <ProductName>Red Hat Hardened Images</ProductName>
        <ReleaseDate>2026-11-13T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:100123">RHSA-2026:100123</Advisory>
        <Package name="postgresql18-main">postgresql18-main-18.7-0.1.hum1</Package>
    </AffectedRelease>
    <AffectedRelease cpe="cpe:/a:redhat:hummingbird:1">
        <ProductName>Red Hat Hardened Images</ProductName>
        <ReleaseDate>2026-11-12T00:00:00Z</ReleaseDate>
        <Advisory type="RHSA" url="https://access.redhat.com/errata/RHSA-2026:99821">RHSA-2026:99821</Advisory>
        <Package name="libpq-main">libpq-main-18.7-0.1.hum1</Package>
    </AffectedRelease>
    <References xml:lang="en:us">
https://www.cve.org/CVERecord?id=CVE-2026-6467
https://nvd.nist.gov/vuln/detail/CVE-2026-6467
https://www.postgresql.org/support/security/CVE-2026-6467/
    </References>
</Vulnerability>