# CVE-2023-5868: Postgresql: memory disclosure in aggregate function calls

> Remote attackers can exploit aggregate function calls with unknown-type arguments to read sensitive system memory in PostgreSQL.

- **Severity:** Medium 4.3 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Dec 2023
- **Updated:** 23 Jun 2026
- **Also known as:** ALPINE-CVE-2023-5868, AZL-32106, BELL-CVE-2023-5868, BIT-postgresql-2023-5868, CLEANSTART-2026-JD37353, DEBIAN-CVE-2023-5868, ECHO-9641-250d-e23f, GHSA-3f9w-7983-qcmq, JLSEC-2026-43, UBUNTU-CVE-2023-5868

## What is CVE-2023-5868?

CVE-2023-5868 is a medium-severity vulnerability in Postgresql Postgresql, published on 10 Dec 2023. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

A memory disclosure vulnerability was found in PostgreSQL that allows remote users to access sensitive information by exploiting certain aggregate function calls with 'unknown'-type arguments. Handling 'unknown'-type values from string literals without type designation can disclose bytes, potentially revealing notable and confidential information. This issue exists due to excessive data output in aggregate function calls, enabling remote users to read some portion of system memory.

Weakness: CWE-686 (Function Call With Incorrect Argument Type)

## Which versions are affected by CVE-2023-5868?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `postgresql` | Bitnami | From 11.0.0 | 11.22.0, 12.17.0, 13.13.0, 14.10.0, 15.5.0, 16.0.1 |

Products: Postgresql Postgresql, Redhat Codeready Linux Builder Eus, Redhat Codeready Linux Builder Eus for Power Little Endian Eus, Redhat Codeready Linux Builder for Arm64 Eus, Redhat Codeready Linux Builder for Ibm Z Systems Eus, Redhat Codeready Linux Builder for Power Little Endian Eus, Redhat Enterprise Linux, Redhat Enterprise Linux Eus, Redhat Enterprise Linux for Arm 64, Redhat Enterprise Linux for Ibm Z Systems, Redhat Enterprise Linux for Ibm Z Systems Eus, Redhat Enterprise Linux for Power Little Endian, Redhat Enterprise Linux for Power Little Endian Eus, Redhat Enterprise Linux Server Aus, Redhat Enterprise Linux Server Tus, Redhat Software Collections.

## How do I fix CVE-2023-5868?

Upgrade postgresql to a fixed version for your release line: 11.22.0, 12.17.0, 13.13.0 or 14.10.0.

## Is CVE-2023-5868 being exploited?

There is no known exploitation of CVE-2023-5868 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-2023-5868 and fix it if it is affected.

What it is: CVE-2023-5868 is a medium-severity vulnerability in Postgresql Postgresql, published on 10 Dec 2023. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-5868 in the wild and no public exploit code.

Affected packages and fixed versions:
- postgresql (Bitnami): affected from 11.0.0; fixed in 11.22.0, 12.17.0, 13.13.0, 14.10.0, 15.5.0, 16.0.1

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-2023-5868/ (Markdown: https://insights.sbomify.com/CVE-2023-5868/index.md)
```

## Sources

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

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