# CVE-2024-10977: PostgreSQL libpq retains an error message from man-in-the-middle

> A man-in-the-middle attacker can inject arbitrary error messages into PostgreSQL clients, potentially misleading users or screen scrapers into treating them as valid data.

- **Severity:** Low 3.1 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 14 Nov 2024
- **Updated:** 3 Nov 2025
- **Also known as:** ALPINE-CVE-2024-10977, AZL-53195, AZL-53206, BELL-CVE-2024-10977, BIT-postgresql-2024-10977, CLEANSTART-2026-AH36441, CLSA-2026-1779707025, DEBIAN-CVE-2024-10977, ECHO-84d0-1dcb-0c06, GHSA-62q4-hc79-94qj, JLSEC-2026-48, MINI-5mr4-xr4r-878x, MINI-8w32-ppgh-q5qj, MINI-xm6g-qh5r-pxpx, UBUNTU-CVE-2024-10977

## What is CVE-2024-10977?

CVE-2024-10977 is a low-severity vulnerability in Postgresql Postgresql, published on 14 Nov 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-345 (Insufficient Verification of Data Authenticity), CWE-348 (Use of Less Trusted Source)

## Which versions are affected by CVE-2024-10977?

1 open source package ship an affected version, including postgresql. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `postgresql` | Bitnami | All versions | 12.21.0, 13.17.0, 14.14.0, 15.9.0, 16.5.0, 17.1.0 |

Products: Postgresql Postgresql.

## How do I fix CVE-2024-10977?

Upgrade postgresql to a fixed version for your release line: 12.21.0, 13.17.0, 14.14.0 or 15.9.0.

## Is CVE-2024-10977 being exploited?

There is no known exploitation of CVE-2024-10977 in the wild and no public exploit code.

## Other vulnerabilities in Postgresql Postgresql

- [CVE-2013-1902](https://insights.sbomify.com/CVE-2013-1902/): Information disclosure in n/a (critical 10.0)
- [CVE-2013-1903](https://insights.sbomify.com/CVE-2013-1903/): Information disclosure in n/a (critical 10.0)
- [CVE-2007-3279](https://insights.sbomify.com/CVE-2007-3279/): Privilege escalation in n/a (critical 10.0)
- [CVE-2002-1399](https://insights.sbomify.com/CVE-2002-1399/): Integer overflow in n/a (critical 10.0)
- [CVE-2016-3065](https://insights.sbomify.com/CVE-2016-3065/): Information disclosure in n/a (critical 9.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-10977 and fix it if it is affected.

What it is: CVE-2024-10977 is a low-severity vulnerability in Postgresql Postgresql, published on 14 Nov 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-10977 in the wild and no public exploit code.

Affected packages and fixed versions:
- postgresql (Bitnami): affected all versions; fixed in 12.21.0, 13.17.0, 14.14.0, 15.9.0, 16.5.0, 17.1.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-10977/ (Markdown: https://insights.sbomify.com/CVE-2024-10977/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-10977
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-10977
- OSV: https://osv.dev/vulnerability/CVE-2024-10977

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-10977/
Summaries are generated and may contain mistakes; the official description above is the record.
