Outdated PostgreSQL

A PostgreSQL server runs a minor release that is missing security fixes, or a major version that is no longer supported.

SeverityHigh
CVSS 3.17.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.07.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
CWECWE-1395: Dependency on Vulnerable Third-Party Component
OWASP Top 10A03:2025 Software Supply Chain Failures
MITRE ATT&CKT1068 Exploitation for Privilege Escalation, T1210 Exploitation of Remote Services
CategoryOutdated 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_upgrade or a dump and restore, after testing applications.
  • Update client libraries such as libpq on application servers, and apply the provider's maintenance updates for managed database services.
  • Restrict access with pg_hba.conf and 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 trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Patching and Outdated Software Findings

Every Patching and Outdated Software finding