cve.bz

CVE-2026-6638 postgresql postgresql: SQL Injection

8.8 highEPSS 0.2%Fix available

High (8.8) in postgresql postgresql. EPSS 0.2% estimated probability of exploitation activity in the next 30 days.

On this page
SQL injection in PostgreSQL logical replication ALTER SUBSCRIPTION ... REFRESH PUBLICATION allows a subscriber table creator to execute arbitrary SQL with the subscription's publication-side credentials. The attack takes effect at the next REFRESH PUBLICATION. Within major versions 16, 17, and 18, minor versions before PostgreSQL 18.4, 17.10, and 16.14 are affected. Versions before PostgreSQL 16 are unaffected.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
0.2% (unchanged from 0.2% a week ago; 0.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 8th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2026-05-14. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-89 Improper Neutralization of Special Elements used in an SQL Command (SQL Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-6638 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-6638?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-6638?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-6638 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
postgresql:postgresqlfrom 16.0 before 16.14
postgresql:postgresqlfrom 17.0 before 17.10
postgresql:postgresqlfrom 18.0 before 18.4

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian13postgresql-1717.10-0+deb13u1DEBIAN-CVE-2026-6638 DSA-6270-1
Debian14postgresql-1818.4-1DEBIAN-CVE-2026-6638
Ubuntu20.04:LTSpostgresql-12no fix listedUBUNTU-CVE-2026-6638
Ubuntu22.04:LTSpostgresql-1414.23-0ubuntu0.22.04.1UBUNTU-CVE-2026-6638
Ubuntu24.04:LTSpostgresql-1616.14-0ubuntu0.24.04.1UBUNTU-CVE-2026-6638
Ubuntu25.10postgresql-1717.10-0ubuntu0.25.10.1UBUNTU-CVE-2026-6638
Ubuntu26.04:LTSpostgresql-1818.4-0ubuntu0.26.04.1UBUNTU-CVE-2026-6638
UbuntuPro:14.04:LTSpostgresql-9.3no fix listedUBUNTU-CVE-2026-6638
UbuntuPro:16.04:LTSpostgresql-9.5no fix listedUBUNTU-CVE-2026-6638
UbuntuPro:18.04:LTSpostgresql-10no fix listedUBUNTU-CVE-2026-6638
Red Hatenterprise_linux:8::appstreampg_repack, pg_repack-debuginfo, pg_repack-debugsource0:1.5.1-1.module+el8.10.0+22551+c0330dc9RHSA-2026:28143
Red Hatenterprise_linux:8::appstreampgaudit, pgaudit-debuginfo, pgaudit-debugsource0:16.0-1.module+el8.10.0+20413+d8116364RHSA-2026:28143
Red Hatenterprise_linux:8::appstreampostgres-decoderbufs, postgres-decoderbufs-debuginfo, postgres-decoderbufs-debugsource0:2.4.0-1.Final.module+el8.10.0+20413+d8116364RHSA-2026:28143
Red Hatenterprise_linux:8::appstreampostgresql, postgresql-docs, postgresql-test and 25 more0:16.14-1.module+el8.10.0+24339+d919fb58RHSA-2026:28143
Red Hatenterprise_linux:9::appstreampg_repack, pg_repack-debuginfo, pg_repack-debugsource0:1.5.1-1.module+el9.8.0+24090+8f0ee565RHSA-2026:26203
Red Hatenterprise_linux:9::appstreampg_repack, pg_repack-debuginfo, pg_repack-debugsource0:1.5.3-1.module+el9.8.0+23739+1c42644cRHSA-2026:26204
Red Hatenterprise_linux:9::appstreampgaudit, pgaudit-debuginfo, pgaudit-debugsource0:16.0-1.module+el9.8.0+24090+8f0ee565RHSA-2026:26203
Red Hatenterprise_linux:9::appstreampgaudit, pgaudit-debuginfo, pgaudit-debugsource0:18.0-1.module+el9.8.0+23739+1c42644cRHSA-2026:26204
Red Hatenterprise_linux:9::appstreampgvector, pgvector-debuginfo, pgvector-debugsource0:0.6.2-2.module+el9.8.0+24090+8f0ee565RHSA-2026:26203
Red Hatenterprise_linux:9::appstreampgvector, pgvector-debuginfo, pgvector-debugsource0:0.8.1-1.module+el9.8.0+23739+1c42644cRHSA-2026:26204
Red Hatenterprise_linux:9::appstreampostgis, postgis-docs, postgis-utils and 6 more0:3.5.3-5.module+el9.8.0+24090+8f0ee565RHSA-2026:26203
Red Hatenterprise_linux:9::appstreampostgis, postgis-docs, postgis-utils and 6 more0:3.6.1-2.module+el9.8.0+23739+1c42644cRHSA-2026:26204
18 more for Red Hat in the JSON and on Red Hat's page.
SUSELinux Enterprise Server 16.0, Linux Enterprise Server for SAP applications 16.0postgresql1616.14-160000.1.1SUSE-SU-2026:22184-1
SUSELinux Enterprise Server 16.0, Linux Enterprise Server for SAP applications 16.0postgresql1717.10-160000.1.1SUSE-SU-2026:22149-1
SUSELinux Enterprise Server 16.0, Linux Enterprise Server for SAP applications 16.0postgresql1818.4-160000.1.1SUSE-SU-2026:22077-1
openSUSELeap 16.0postgresql1616.14-160000.1.1openSUSE-SU-2026:21104-1
openSUSELeap 16.0postgresql1717.10-160000.1.1openSUSE-SU-2026:20970-1
openSUSETumbleweedpostgresql1616.14-1.1openSUSE-SU-2026:10808-1
openSUSETumbleweedpostgresql1717.10-1.1openSUSE-SU-2026:10809-1
openSUSETumbleweedpostgresql1818.4-1.1openSUSE-SU-2026:10828-1
AlmaLinux8pg_repack1.5.1-1.module_el8.10.0+3930+ecf33554ALSA-2026:28143
AlmaLinux8pg_repack1.5.1-1.module_el8.10.0+4125+ceaf7d1bALSA-2026:28143
AlmaLinux8pg_repack1.5.1-1.module_el8.10.0+4199+bf03c564ALSA-2026:28143
AlmaLinux8pgaudit16.0-1.module_el8.10.0+3798+606ebb9fALSA-2026:28143
AlmaLinux8postgres-decoderbufs2.4.0-1.Final.module_el8.10.0+3798+606ebb9fALSA-2026:28143
AlmaLinux8postgresql, postgresql-docs, postgresql-test and 12 more16.14-1.module_el8.10.0+4199+bf03c564ALSA-2026:28143
AlmaLinux9pg_repack1.5.1-1.module_el9.6.0+146+c54fdecaALSA-2026:26203
AlmaLinux9pg_repack1.5.3-1.module_el9.8.0+234+5456f35dALSA-2026:26204
AlmaLinux9pgaudit16.0-1.module_el9.4.0+66+eb9878bcALSA-2026:26203
AlmaLinux9pgaudit18.0-1.module_el9.8.0+234+5456f35dALSA-2026:26204
AlmaLinux9pgvector0.6.2-2.module_el9.6.0+167+4e561146ALSA-2026:26203
AlmaLinux9pgvector0.8.1-1.module_el9.8.0+234+5456f35dALSA-2026:26204
8 more for AlmaLinux in the JSON.
Alpinev3.20, v3.21, v3.22 and 2 morepostgresql1616.14-r0ALPINE-CVE-2026-6638
Alpinev3.21, v3.22, v3.23 and 1 morepostgresql1717.10-r0ALPINE-CVE-2026-6638
Alpinev3.23, v3.24postgresql1818.4-r0ALPINE-CVE-2026-6638
Azure Linux3postgresql16.14-1AZL-86825
Alpaquita25postgresql1717.10-r0BELL-CVE-2026-6638
Alpaquitastreampostgresql1818.4-r0BELL-CVE-2026-6638

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine · Alpaquita.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

SQL injection in PostgreSQL logical replication allows a subscriber-side table creator to execute arbitrary SQL on the publisher using the subscription's publication-side credentials. ALTER SUBSCRIPTION ... REFRESH PUBLICATION interpolates subscriber-side schema and relation names into SQL sent to the publisher without properly quoting them; a crafted relation name can therefore inject arbitrary SQL that runs with the privileges of the subscription's publication-side role the next time REFRESH PUBLICATION is executed. Exploitation requires the attacker to already hold table-creation privileges on the subscriber database, for logical replication to be configured with an untrusted subscriber-side user, and for a privileged user to subsequently run REFRESH PUBLICATION, which limits the practical attack surface for most default deployments. Only PostgreSQL major versions 16, 17, and 18 are affected; versions prior to 16 do not include the vulnerable code path (introduced by commit 875693019053b8897ec3983e292acbb439b088c3).

Red Hat's mitigation

Upgrade to PostgreSQL 18.4, 17.10, or 16.14 (matching your major version) or later, which corrects the identifier quoting used when the subscriber's apply worker sends the REFRESH PUBLICATION SQL to the publisher. Versions prior to PostgreSQL 16 are not affected. As a temporary mitigation, restrict CREATE TABLE / table-ownership privileges on subscriber databases to trusted roles only, avoid configuring logical replication subscriptions for untrusted subscriber-side users, and scope the subscription's publication-side credentials to the minimum privileges necessary.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10postgresql18-0:18.4-1.el10_2Fixed 2026-06-22RHSA-2026:27742
Red Hat Enterprise Linux 10postgresql16-0:16.14-1.el10_2Fixed 2026-06-22RHSA-2026:27743
Red Hat Enterprise Linux 10.0 Extended Update Supportpostgresql16-0:16.14-1.el10_0Fixed 2026-06-22RHSA-2026:27718
Red Hat Enterprise Linux 8postgresql:16-8100020260530205218.489197e6Fixed 2026-06-23RHSA-2026:28143
Red Hat Enterprise Linux 9postgresql:16-9080020260605131007.rhel9Fixed 2026-06-16RHSA-2026:26203
Red Hat Enterprise Linux 9postgresql:18-9080020260605125734.rhel9Fixed 2026-06-16RHSA-2026:26204
Red Hat Enterprise Linux 9.4 Update Services for SAP Solutionspostgresql:16-9040020260612132455.rhel9Fixed 2026-06-17RHSA-2026:26524
Red Hat Enterprise Linux 9.6 Extended Update Supportpostgresql:16-9060020260612084605.rhel9Fixed 2026-06-17RHSA-2026:26525
Red Hat Hardened Imagespostgresql17-main-17.10-0.1.hum1Fixed 2026-05-26RHSA-2026:21182
Red Hat Hardened Imagespostgresql18-main-18.4-0.1.hum1Fixed 2026-06-03RHSA-2026:22878
Red Hat Enterprise Linux 6postgresqlNot affected
Red Hat Enterprise Linux 7postgresqlNot affected
Red Hat Enterprise Linux 8postgresql:12/postgresqlNot affected
Red Hat Enterprise Linux 8postgresql:15/postgresqlNot affected
Red Hat Enterprise Linux 9postgresqlNot affected
Red Hat Enterprise Linux 9postgresql:15/postgresqlNot affected
Self-service automation portal 2ansible-automation-platform/bootc-automation-portal-rhel9Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-6638.

Attack patterns (CAPEC)

  • CAPEC-7 Blind SQL Injection Likelihood: High · Severity: High
  • CAPEC-66 SQL Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High
  • CAPEC-109 Object Relational Mapping Injection Likelihood: Low · Severity: High
  • CAPEC-110 SQL Injection through SOAP Parameter Tampering Likelihood: High · Severity: Very High
  • CAPEC-470 Expanding Control over the Operating System from the Database Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON