Cloudanix VulnDB

CVE-2024-10977

None

CVSS

—

EPSS

0.4%

Published

Nov 14, 2024

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

An older database server could trick users or tools into seeing fake information mixed in with real query results if the connection is not properly secured.

Exploitation
Adjacent Network
Attacker needs
None
Complexity
High
Impact
Data Exposure
Component
Library
Class
Information Disclosure
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

A PostgreSQL server not validated under SSL or GSS can inject arbitrary non-NUL bytes into error messages returned to libpq clients, allowing the bytes to be interpreted as query output by tools such as psql or screen scrapers.

Why it matters to the business

Organizations running older PostgreSQL versions face a low-probability risk that database query results could be falsified for human operators or automated parsers, potentially leading to incorrect decisions or data mishandling; the large installed base of affected releases increases the window of exposure until upgrades are completed.

How an attack unfolds

An attacker positioned as a man-in-the-middle or operating an untrusted PostgreSQL server sends a crafted, lengthy error message containing arbitrary bytes to a connecting libpq client; the client application displays or processes the message without clear separation from legitimate results, causing a user or downstream script to mistake the injected content for valid query output.

How to fix it

Upgrade PostgreSQL to 17.1, 16.5, 15.9, 14.14, 13.17, or 12.21 or later; apply the corresponding fixed package versions for affected Ubuntu releases (for example 3.13.0-73.116 on Ubuntu 14.04 LTS and 4.3.0-1.10 on Ubuntu 16.04 LTS) and rebuild or redeploy any applications linking against the updated libpq.

How to confirm the fix worked

Verify server version strings match or exceed the fixed releases listed above; test connections with both trusted and untrusted SSL/GSS settings while observing that long error messages no longer appear as undifferentiated text in psql output; confirm the commit 20a82026828536331ebe912b86f060078a173633 is present in source builds.

Typical attack path

  1. Attacker intercepts or controls the PostgreSQL server connection
  2. Attacker crafts an error message containing arbitrary non-NUL bytes
  3. Message is delivered to the libpq client during query processing
  4. Client UI or parser presents the message without clear boundary markers
  5. Human operator or screen-scraping tool misinterprets the bytes as query results

How to detect it

Review PostgreSQL client logs and psql session transcripts for unusually long or malformed error messages that appear adjacent to query results; examine application logs for unexpected data patterns following database error handling routines; correlate connection attempts from untrusted hosts or without certificate validation.

What your security team should do

  • Prioritize upgrade of all PostgreSQL instances to the fixed versions within the next maintenance window
  • Audit client applications that parse psql or libpq error output for clear boundary handling
  • Enable SSL certificate validation or GSS authentication for all database connections where feasible
  • Monitor EPSS trend and threat intelligence feeds for any increase in exploitation activity

The record

Client use of server error message in PostgreSQL allows a server not trusted under current SSL or GSS settings to furnish arbitrary non-NUL bytes to the libpq application. For example, a man-in-the-middle attacker could send a long error message that a human or screen-scraper user of psql mistakes for valid query results. This is probably not a concern for clients where the user interface unambiguously indicates the boundary between one error message and other text. Versions before PostgreSQL 17.1, 16.5, 15.9, 14.14, 13.17, and 12.21 are affected.

Affected packages

Ecosystem Package Introduced Fixed
Alpine:v3.17 postgresql14 0 14.14-r0
Alpine:v3.17 postgresql15 0 15.9-r0
Alpine:v3.18 postgresql14 0 14.14-r0
Alpine:v3.18 postgresql15 0 15.9-r0
Alpine:v3.19 postgresql15 0 15.9-r0
Alpine:v3.19 postgresql16 0 16.5-r0
Alpine:v3.20 postgresql15 0 15.9-r0
Alpine:v3.20 postgresql16 0 16.5-r0
Alpine:v3.21 postgresql16 0 16.5-r0
Alpine:v3.21 postgresql17 0 17.1-r0
Alpine:v3.22 postgresql16 0 16.5-r0
Alpine:v3.22 postgresql17 0 17.1-r0
Bitnami postgresql 0 12.21.0
Bitnami postgresql 0 13.17.0
Bitnami postgresql 17.0.0 17.1.0
Chainguard ecpg-13 0 13.17-r0
Chainguard ecpg-14 0 14.14-r0
Chainguard ecpg-15 0 15.9-r0
Chainguard ecpg-16 0 16.5-r0
Chainguard ecpg-17 0 17.1-r0
Chainguard libecpg-12 0 12.21-r0
Chainguard libecpg-13 0 13.17-r0
Chainguard libecpg-13-dev 0 13.17-r0
Chainguard libecpg-14 0 14.14-r0
Chainguard libecpg-14-dev 0 14.14-r0
Chainguard libecpg-15 0 15.9-r0
Chainguard libecpg-15-dev 0 15.9-r0
Chainguard libecpg-16 0 16.5-r0
Chainguard libecpg-16-dev 0 16.5-r0
Chainguard libecpg-17 0 17.1-r0
Chainguard libecpg-17-dev 0 17.1-r0
Chainguard libpq-12 0 12.21-r0
Chainguard libpq-13 0 13.17-r0
Chainguard libpq-14 0 14.14-r0
Chainguard libpq-15 0 15.9-r0
Chainguard libpq-16 0 16.5-r0
Chainguard libpq-17 0 17.1-r0
Chainguard postgresql-12 0 12.21-r0
Chainguard postgresql-12-base 0 12.21-r0
Chainguard postgresql-12-bitnami-compat 0 12.21-r0
Chainguard postgresql-12-client 0 12.21-r0
Chainguard postgresql-12-client-base 0 12.21-r0
Chainguard postgresql-12-contrib 0 12.21-r0
Chainguard postgresql-12-dev 0 12.21-r0
Chainguard postgresql-12-oci-entrypoint 0 12.21-r0
Chainguard postgresql-12-oci-entrypoint-base 0 12.21-r0
Chainguard postgresql-12-pgadmin-compat 0 12.21-r0
Chainguard postgresql-13 0 13.17-r0
Chainguard postgresql-13-base 0 13.17-r0
Chainguard postgresql-13-bitnami-compat 0 13.17-r0
Chainguard postgresql-13-client 0 13.17-r0
Chainguard postgresql-13-client-base 0 13.17-r0
Chainguard postgresql-13-contrib 0 13.17-r0
Chainguard postgresql-13-dev 0 13.17-r0
Chainguard postgresql-13-oci-entrypoint 0 13.17-r0
Chainguard postgresql-13-oci-entrypoint-base 0 13.17-r0
Chainguard postgresql-13-pgadmin-compat 0 13.17-r0
Chainguard postgresql-14 0 14.14-r0
Chainguard postgresql-14-base 0 14.14-r0
Chainguard postgresql-14-bitnami-compat 0 14.14-r0
Chainguard postgresql-14-client 0 14.14-r0
Chainguard postgresql-14-client-base 0 14.14-r0
Chainguard postgresql-14-contrib 0 14.14-r0
Chainguard postgresql-14-dev 0 14.14-r0
Chainguard postgresql-14-oci-entrypoint 0 14.14-r0
Chainguard postgresql-14-oci-entrypoint-base 0 14.14-r0
Chainguard postgresql-14-pgadmin-compat 0 14.14-r0
Chainguard postgresql-15 0 15.9-r0
Chainguard postgresql-15-base 0 15.9-r0
Chainguard postgresql-15-bitnami-compat 0 15.9-r0
Chainguard postgresql-15-client 0 15.9-r0
Chainguard postgresql-15-client-base 0 15.9-r0
Chainguard postgresql-15-contrib 0 15.9-r0
Chainguard postgresql-15-dev 0 15.9-r0
Chainguard postgresql-15-oci-entrypoint 0 15.9-r0
Chainguard postgresql-15-oci-entrypoint-base 0 15.9-r0
Chainguard postgresql-15-pgadmin-compat 0 15.9-r0
Chainguard postgresql-16 0 16.5-r0
Chainguard postgresql-16-base 0 16.5-r0
Chainguard postgresql-16-client 0 16.5-r0
Chainguard postgresql-16-client-base 0 16.5-r0
Chainguard postgresql-16-contrib 0 16.5-r0
Chainguard postgresql-16-dev 0 16.5-r0
Chainguard postgresql-16-oci-entrypoint 0 16.5-r0
Chainguard postgresql-16-oci-entrypoint-base 0 16.5-r0
Chainguard postgresql-16-pgadmin-compat 0 16.5-r0
Chainguard postgresql-17 0 17.1-r0
Chainguard postgresql-17-base 0 17.1-r0
Chainguard postgresql-17-client 0 17.1-r0
Chainguard postgresql-17-client-base 0 17.1-r0
Chainguard postgresql-17-contrib 0 17.1-r0
Chainguard postgresql-17-dev 0 17.1-r0
Chainguard postgresql-17-oci-entrypoint 0 17.1-r0
Chainguard postgresql-17-oci-entrypoint-base 0 17.1-r0
Chainguard postgresql-17-pgadmin-compat 0 17.1-r0
Chainguard py3.10-plpython 0 17.1-r0
Chainguard py3.10-plpython-17 0 17.1-r0
Chainguard py3.11-plpython 0 17.1-r0
Chainguard py3.11-plpython-17 0 17.1-r0
Chainguard py3.12-plpython 0 17.1-r0
Chainguard py3.12-plpython-17 0 17.1-r0
Chainguard py3.13-plpython 0 17.1-r0
Chainguard py3.13-plpython-17 0 17.1-r0
Debian:11 postgresql-13 0 No fix
Debian:11 postgresql-13 0 13.17-0+deb11u1
Debian:12 postgresql-15 0 15.9-0+deb12u1
Debian:13 postgresql-16 0 No fix
Debian:13 postgresql-17 0 No fix
Debian:14 postgresql-17 0 17.1-1
Mageia:9 postgresql13 0 13.18-1.mga9
Mageia:9 postgresql15 0 15.10-1.mga9
SUSE:Enterprise Storage 7.1 postgresql 0 17-150300.10.27.1
SUSE:Enterprise Storage 7.1 postgresql12 0 12.22-150200.8.66.1
SUSE:Enterprise Storage 7.1 postgresql13 0 13.18-150200.5.64.1
SUSE:Enterprise Storage 7.1 postgresql14 0 14.15-150200.5.50.1
SUSE:Enterprise Storage 7.1 postgresql15 0 15.10-150200.5.33.1
SUSE:Enterprise Storage 7.1 postgresql16 0 16.6-150200.5.21.1
SUSE:Enterprise Storage 7.1 postgresql17 0 17.2-150200.5.5.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS postgresql 0 17-150200.4.30.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS postgresql12 0 12.22-150200.8.66.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS postgresql13 0 13.18-150200.5.64.1
SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS postgresql14 0 14.15-150200.5.50.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS postgresql 0 17-150300.10.27.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS postgresql12 0 12.22-150200.8.66.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS postgresql13 0 13.18-150200.5.64.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS postgresql14 0 14.15-150200.5.50.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS postgresql15 0 15.10-150200.5.33.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS postgresql16 0 16.6-150200.5.21.1
SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS postgresql17 0 17.2-150200.5.5.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS postgresql 0 17-150400.4.18.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS postgresql13 0 13.18-150200.5.64.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS postgresql14 0 14.15-150200.5.50.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS postgresql15 0 15.10-150200.5.33.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS postgresql16 0 16.6-150200.5.21.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS postgresql17 0 17.2-150200.5.5.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS postgresql 0 17-150400.4.18.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS postgresql13 0 13.18-150200.5.64.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS postgresql14 0 14.15-150200.5.50.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS postgresql15 0 15.10-150200.5.33.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS postgresql16 0 16.6-150200.5.21.1
SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS postgresql17 0 17.2-150200.5.5.1
SUSE:Linux Enterprise Module for Basesystem 15 SP5 postgresql 0 17-150500.10.9.1
SUSE:Linux Enterprise Module for Basesystem 15 SP5 postgresql15 0 15.10-150200.5.33.1
SUSE:Linux Enterprise Module for Basesystem 15 SP5 postgresql16 0 16.6-150200.5.21.1
SUSE:Linux Enterprise Module for Basesystem 15 SP5 postgresql17 0 17.2-150200.5.5.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 postgresql 0 17-150600.17.6.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 postgresql16 0 16.6-150600.16.10.1
SUSE:Linux Enterprise Module for Basesystem 15 SP6 postgresql17 0 17.2-150600.13.5.1
SUSE:Linux Enterprise Module for Legacy 15 SP5 postgresql 0 17-150500.10.9.1
SUSE:Linux Enterprise Module for Legacy 15 SP5 postgresql14 0 14.15-150200.5.50.1
SUSE:Linux Enterprise Module for Legacy 15 SP6 postgresql14 0 14.15-150600.16.9.1
SUSE:Linux Enterprise Module for Legacy 15 SP6 postgresql15 0 15.10-150600.16.9.1
SUSE:Linux Enterprise Module for Package Hub 15 SP5 postgresql 0 17-150500.10.9.1
SUSE:Linux Enterprise Module for Package Hub 15 SP5 postgresql14 0 14.15-150200.5.50.1
SUSE:Linux Enterprise Module for Package Hub 15 SP5 postgresql16 0 16.6-150200.5.21.1
SUSE:Linux Enterprise Module for Package Hub 15 SP5 postgresql17 0 17.2-150200.5.5.1
SUSE:Linux Enterprise Module for Package Hub 15 SP6 postgresql 0 17-150600.17.6.1
SUSE:Linux Enterprise Module for Package Hub 15 SP6 postgresql14 0 14.15-150600.16.9.1
SUSE:Linux Enterprise Module for Package Hub 15 SP6 postgresql16 0 16.6-150600.16.10.1
SUSE:Linux Enterprise Module for Package Hub 15 SP6 postgresql17 0 17.2-150600.13.5.1
SUSE:Linux Enterprise Module for Server Applications 15 SP5 postgresql 0 17-150500.10.9.1
SUSE:Linux Enterprise Module for Server Applications 15 SP5 postgresql15 0 15.10-150200.5.33.1
SUSE:Linux Enterprise Module for Server Applications 15 SP5 postgresql16 0 16.6-150200.5.21.1
SUSE:Linux Enterprise Module for Server Applications 15 SP5 postgresql17 0 17.2-150200.5.5.1
SUSE:Linux Enterprise Module for Server Applications 15 SP6 postgresql 0 17-150600.17.6.1
SUSE:Linux Enterprise Module for Server Applications 15 SP6 postgresql16 0 16.6-150600.16.10.1
SUSE:Linux Enterprise Module for Server Applications 15 SP6 postgresql17 0 17.2-150600.13.5.1
SUSE:Linux Enterprise Server 12 SP5-LTSS postgresql 0 17-4.29.1
SUSE:Linux Enterprise Server 12 SP5-LTSS postgresql12 0 12.22-3.63.1
SUSE:Linux Enterprise Server 12 SP5-LTSS postgresql13 0 13.18-3.55.2
SUSE:Linux Enterprise Server 12 SP5-LTSS postgresql14 0 14.15-3.49.1
SUSE:Linux Enterprise Server 12 SP5-LTSS postgresql15 0 15.10-3.33.1
SUSE:Linux Enterprise Server 12 SP5-LTSS postgresql16 0 16.6-3.21.1
SUSE:Linux Enterprise Server 12 SP5-LTSS postgresql17 0 17.2-3.5.1
SUSE:Linux Enterprise Server 15 SP2-LTSS postgresql 0 17-150200.4.30.1
SUSE:Linux Enterprise Server 15 SP2-LTSS postgresql12 0 12.22-150200.8.66.1
SUSE:Linux Enterprise Server 15 SP2-LTSS postgresql13 0 13.18-150200.5.64.1
SUSE:Linux Enterprise Server 15 SP2-LTSS postgresql14 0 14.15-150200.5.50.1
SUSE:Linux Enterprise Server 15 SP3-LTSS postgresql 0 17-150300.10.27.1
SUSE:Linux Enterprise Server 15 SP3-LTSS postgresql12 0 12.22-150200.8.66.1
SUSE:Linux Enterprise Server 15 SP3-LTSS postgresql13 0 13.18-150200.5.64.1
SUSE:Linux Enterprise Server 15 SP3-LTSS postgresql14 0 14.15-150200.5.50.1
SUSE:Linux Enterprise Server 15 SP3-LTSS postgresql15 0 15.10-150200.5.33.1
SUSE:Linux Enterprise Server 15 SP3-LTSS postgresql16 0 16.6-150200.5.21.1
SUSE:Linux Enterprise Server 15 SP3-LTSS postgresql17 0 17.2-150200.5.5.1
SUSE:Linux Enterprise Server 15 SP4-LTSS postgresql 0 17-150400.4.18.1
SUSE:Linux Enterprise Server 15 SP4-LTSS postgresql13 0 13.18-150200.5.64.1
SUSE:Linux Enterprise Server 15 SP4-LTSS postgresql14 0 14.15-150200.5.50.1
SUSE:Linux Enterprise Server 15 SP4-LTSS postgresql15 0 15.10-150200.5.33.1
SUSE:Linux Enterprise Server 15 SP4-LTSS postgresql16 0 16.6-150200.5.21.1
SUSE:Linux Enterprise Server 15 SP4-LTSS postgresql17 0 17.2-150200.5.5.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 postgresql 0 17-4.29.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 postgresql12 0 12.22-3.63.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 postgresql13 0 13.18-3.55.2
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 postgresql14 0 14.15-3.49.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 postgresql15 0 15.10-3.33.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 postgresql16 0 16.6-3.21.1
SUSE:Linux Enterprise Server LTSS Extended Security 12 SP5 postgresql17 0 17.2-3.5.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP2 postgresql 0 17-150200.4.30.1
SUSE:Linux Enterprise Server for SAP Applications 15 SP2 postgresql12 0 12.22-150200.8.66.1

Related vulnerabilities