Outdated PostgreSQL
A PostgreSQL server runs a minor release that is missing security fixes, or a major version that is no longer supported.
| Severity | High |
| CVSS 3.1 | 7.5 CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H Open in the calculator |
| CVSS 4.0 | 7.7 CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-1395: Dependency on Vulnerable Third-Party Component |
| OWASP Top 10 | A03:2025 Software Supply Chain Failures |
| MITRE ATT&CK | T1068 Exploitation for Privilege Escalation, T1210 Exploitation of Remote Services |
| Category | Outdated Components |
Description
A PostgreSQL server runs a minor release that predates fixes for one or more published vulnerabilities, or a major version that has reached end of life. The PostgreSQL project supports each major version for five years and releases fixes, including security fixes, at least once every three months as minor releases, which it recommends always installing; unsupported major versions accumulate unfixed flaws over time.
Recent PostgreSQL vulnerabilities have mostly needed a database login and allowed privilege escalation, for example by causing a command run by a more privileged user to execute a less privileged user's code, along with SQL injection through the client library's quoting functions (CVE-2025-1094), bypasses of row security and disclosure of server memory. A user with a database login can use them to gain the privileges of another role, up to superuser, or to read data that row security should hide. A PostgreSQL superuser can run operating system commands as the database service account, for example with COPY ... TO PROGRAM, so privilege escalation within the database usually leads to control of the database host and every database on it. Few PostgreSQL flaws are exploitable without credentials, so the risk is greatest where untrusted users or compromised applications hold logins, or where the database port is reachable from untrusted networks.
The finding is identified from installed packages in an authenticated scan or with SELECT version();, as PostgreSQL reports its version only after authentication and unauthenticated scanners can infer it only approximately. Scanners report one result per advisory affecting that version. Linux distributions and managed database services backport or apply fixes on their own schedules, so results should be confirmed against the provider's advisories. Copies of PostgreSQL bundled with other products, and the libpq client library used by applications, also need updating.
Remediation
Keep each server on the current minor release of a supported major version:
- Install the latest minor release for the major version in use, from the PostgreSQL project's packages or the distribution, and restart the server. Minor releases do not need a dump and restore, but their release notes can list extra steps, such as rebuilding certain indexes, which should be followed.
- Upgrade major versions that have reached end of life, using
pg_upgradeor a dump and restore, after testing applications. - Update client libraries such as
libpqon application servers, and apply the provider's maintenance updates for managed database services. - Restrict access with
pg_hba.confand network controls to the hosts and users that need it, avoid granting superuser rights or the ability to create objects in shared schemas to application and untrusted roles, and keep the number of superusers small.
Confirm the fix with SELECT version(); on each server, compared with the minor release that fixes each reported CVE.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.