CVE-2026-6638 PostgreSQL REFRESH PUBLICATION allows SQL injection via table name

Low 3.7 Published Updated

A subscriber table creator can execute arbitrary SQL with publication-side credentials via logical replication refresh, requiring an upgrade to fix.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-6638?

CVE-2026-6638 is a low-severity SQL injection vulnerability in Postgresql Postgresql, published on 14 May 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

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.

Weakness: CWE-89

Which versions are affected by CVE-2026-6638?

1 open source package ship an affected version, including postgresql. It affects 1 product.

PackageAffectedFixed in
postgresql BitnamiFrom 16.0.016.14.0, 17.10.0, 18.4.0

Products include Postgresql Postgresql.

How do I fix CVE-2026-6638?

Upgrade postgresql to a fixed version for your release line: 16.14.0, 17.10.0 or 18.4.0.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2026-6638 being exploited?

There is no known exploitation of CVE-2026-6638 in the wild and no public exploit code.

All Postgresql Postgresql vulnerabilities

Sources

Also known as ALPINE-CVE-2026-6638, AZL-86825, BELL-CVE-2026-6638, BIT-postgresql-2026-6638, DEBIAN-CVE-2026-6638, ECHO-1169-1a51-1552 and 6 more.

Is CVE-2026-6638 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free