# CVE-2023-5869: Postgresql: buffer overrun from integer overflow in array modification

> Authenticated users can trigger an integer overflow in array modification to execute arbitrary code and read server memory.

- **Severity:** High 8.8 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **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:** 11 Mar 2026
- **Also known as:** ALPINE-CVE-2023-5869, ALSA-2023:7790, AZL-32104, BELL-CVE-2023-5869, BIT-postgresql-2023-5869, CLEANSTART-2026-ZS91347, CLSA-2023-1703610792, CLSA-2024-1707420507, DEBIAN-CVE-2023-5869, ECHO-bdca-6110-0f62, GHSA-9625-p7pg-3cxg, JLSEC-2026-44, RHSA-2023:7771, RHSA-2023:7778, RHSA-2023:7783, RHSA-2023:7786, RHSA-2023:7788, RHSA-2023:7789, RHSA-2023:7790, RHSA-2023:7878, RLSA-2023:7790, UBUNTU-CVE-2023-5869

## What is CVE-2023-5869?

CVE-2023-5869 is a high-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 flaw was found in PostgreSQL that allows authenticated database users to execute arbitrary code through missing overflow checks during SQL array value modification. This issue exists due to an integer overflow during array modification where a remote user can trigger the overflow by providing specially crafted data. This enables the execution of arbitrary code on the target system, allowing users to write arbitrary bytes to memory and extensively read the server's memory.

Weakness: CWE-190 (Integer Overflow or Wraparound)

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

1 open source package ship an affected version, including postgresql. It affects 21 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 |
| `postgresql` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-contrib` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-docs` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-plperl` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-plpython3` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-pltcl` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-server` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-server-devel` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-static` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-test` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-test-rpm-macros` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-upgrade` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql-upgrade-devel` | AlmaLinux:8 | All versions | 10.23-3.module_el8.9.0+3703+a01fd377 |
| `postgresql` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-contrib` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-debuginfo` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-devel` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-docs` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-libs` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-plperl` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-plpython` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-pltcl` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-server` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-static` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-test` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-upgrade` | Red Hat:enterprise_linux:7::client | All versions | 0:9.2.24-9.el7_9 |
| `postgresql` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-contrib` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-debuginfo` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-devel` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-docs` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-plperl` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-plpython` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-pltcl` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-server` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-static` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-test` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql-upgrade` | Red Hat:enterprise_linux:7::computenode | All versions | 0:9.2.24-9.el7_9 |
| `postgresql` | Red Hat:enterprise_linux:7::server | All versions | 0:9.2.24-9.el7_9 |

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 Desktop, 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 Big Endian, Redhat Enterprise Linux for Power Little Endian, Redhat Enterprise Linux for Power Little Endian Eus, Redhat Enterprise Linux for Scientific Computing, Redhat Enterprise Linux Server, Redhat Enterprise Linux Server Aus, Redhat Enterprise Linux Server Tus, Redhat Enterprise Linux Workstation and 1 more.

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

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-5869 being exploited?

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

What it is: CVE-2023-5869 is a high-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-5869 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-5869/ (Markdown: https://insights.sbomify.com/CVE-2023-5869/index.md)
```

## Sources

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

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