CVE-2026-15741·PostgreSQL vulnerability
SQL injection in PostgreSQL EXTRACT() deparse allows an object owner to execute arbitrary SQL as a superuser via a hostile object definition. Attacks affect expression deparse consumers broadly, including pg_dump, psql commands like \sf, and any similar usage in non-core tools. Versions before PostgreSQL 18.6, 17.11, 16.15, 15.19, and 14.24 are affected.
- Severity
- high
- Software
- PostgreSQL
- Fixed in
- 18.5
- Published
How likely is exploitation
FIRST's Exploit Prediction Scoring System puts the probability of this CVE being exploited in the next 30 days at 0.47% — higher than 38% of all published CVEs. EPSS is an independent forecast of exploitation, not a severity rating: it says nothing about how much damage a successful attack does, which is what a CVSS score measures.
Read the two together. CVE-2026-15741 scores 8.8 on CVSS, so a successful attack would be serious — but at 0.47%, almost nobody is currently attempting it. That is a different situation from a flaw under mass exploitation, and it is usually the difference between patching on your next maintenance window and patching tonight.
Affected versions
From: 18.0
Until: 18.5
Fixed in: 18.5
How to fix this CVE
Upgrade PostgreSQL to version 18.6 or later to patch a critical SQL injection vulnerability in the EXTRACT() function's deparse logic. This flaw allows database object owners to execute arbitrary SQL commands with superuser privileges. Ensure all database tools that consume expression deparse output (pg_dump, psql, third-party utilities) are updated in tandem with the server.
sudo dnf update postgresql-server postgresql-contrib postgresql-libsDefensia detects this vulnerability
How to check if you are affected
- Run `psql --version` or `SELECT version();` inside psql to confirm the installed PostgreSQL version and verify it is below 18.6
- Check if database roles other than superuser have object creation privileges: `SELECT rolname, rolcreatedb FROM pg_roles WHERE rolcreatedb = true;`
- Search PostgreSQL logs for EXTRACT() function calls in CREATE or ALTER statements targeting custom expressions: `grep -i 'EXTRACT' /var/log/postgresql/postgresql.log | grep -i 'CREATE\|ALTER'`
- After patching, re-run `SELECT version();` to confirm the version is 18.6 or higher
FAQ
What is CVE-2026-15741?
This vulnerability is a SQL injection flaw in PostgreSQL's EXTRACT() function deparse mechanism that allows database object owners to escalate privileges and execute arbitrary SQL as a superuser by crafting malicious object definitions.
Is CVE-2026-15741 being actively exploited?
No, CVE-2026-15741 is not listed in CISA's Known Exploited Vulnerabilities catalog and no public exploits are currently available. However, the high CVSS score and privilege escalation capability warrant immediate patching.
What versions of PostgreSQL are affected by CVE-2026-15741?
PostgreSQL versions 18.0 through 18.5, along with 17.10, 16.14, 15.18, and 14.23 and earlier versions of their respective major releases are affected. Version 18.6 and later contain the fix.
How do I check if my server is vulnerable to CVE-2026-15741?
Connect to PostgreSQL and run `SELECT version();` If the version is below 18.6 in the 18.x branch (or corresponding older branches), your installation is vulnerable.
Does Defensia detect CVE-2026-15741?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If PostgreSQL is installed on a monitored server, CVE-2026-15741 will appear in your dashboard with remediation steps.
Related PostgreSQL CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-15741. Free for 1 server.
Get started free