CVE-2025-12818 PostgreSQL libpq undersizes allocations, via integer wraparound
An attacker can cause a segmentation fault in applications using libpq by triggering an integer wraparound that leads to undersized memory allocations.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-12818?
CVE-2025-12818 is a medium-severity vulnerability in PostgreSQL, published on 13 Nov 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Integer wraparound in multiple PostgreSQL libpq client library functions allows an application input provider or network peer to cause libpq to undersize an allocation and write out-of-bounds by hundreds of megabytes. This results in a segmentation fault for the application using libpq. Versions before PostgreSQL 18.1, 17.7, 16.11, 15.15, 14.20, and 13.23 are affected.
Weakness: CWE-190
Which versions are affected by CVE-2025-12818?
1 open source package ship an affected version, including postgresql.
| Package | Affected | Fixed in |
|---|---|---|
postgresql Bitnami | All versions | 13.23.0, 14.20.0, 15.15.0, 16.11.0, 17.7.0, 18.1.0 |
Linux distribution packages (39)
libpq AlmaLinux:10 | All versions | 16.11-3.el10_1 |
libpq-devel AlmaLinux:10 | All versions | 16.11-3.el10_1 |
postgresql-test-rpm-macros AlmaLinux:10 | All versions | 16.11-1.el10_1 |
libpq AlmaLinux:8 | All versions | 13.23-1.el8_10 |
libpq-devel AlmaLinux:8 | All versions | 13.23-1.el8_10 |
libpq AlmaLinux:9 | All versions | 13.23-1.el9_7 |
libpq-devel AlmaLinux:9 | All versions | 13.23-1.el9_7 |
libpq Red Hat:enterprise_linux:10.1 | All versions | 0:16.11-3.el10_1 |
libpq-debuginfo Red Hat:enterprise_linux:10.1 | All versions | 0:16.11-3.el10_1 |
libpq-debugsource Red Hat:enterprise_linux:10.1 | All versions | 0:16.11-3.el10_1 |
libpq-devel Red Hat:enterprise_linux:10.1 | All versions | 0:16.11-3.el10_1 |
libpq-devel-debuginfo Red Hat:enterprise_linux:10.1 | All versions | 0:16.11-3.el10_1 |
libpq Red Hat:enterprise_linux:8::appstream | All versions | 0:13.23-1.el8_10 |
libpq-debuginfo Red Hat:enterprise_linux:8::appstream | All versions | 0:13.23-1.el8_10 |
libpq-debugsource Red Hat:enterprise_linux:8::appstream | All versions | 0:13.23-1.el8_10 |
libpq-devel Red Hat:enterprise_linux:8::appstream | All versions | 0:13.23-1.el8_10 |
libpq-devel-debuginfo Red Hat:enterprise_linux:8::appstream | All versions | 0:13.23-1.el8_10 |
libpq Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-1.el9_7 |
libpq-debuginfo Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-1.el9_7 |
libpq-debugsource Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-1.el9_7 |
libpq-devel Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-1.el9_7 |
libpq-devel-debuginfo Red Hat:enterprise_linux:9::appstream | All versions | 0:13.23-1.el9_7 |
libpq Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.11-1.el10_0 |
libpq-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.11-1.el10_0 |
libpq-debugsource Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.11-1.el10_0 |
libpq-devel Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.11-1.el10_0 |
libpq-devel-debuginfo Red Hat:enterprise_linux_eus:10.0 | All versions | 0:16.11-1.el10_0 |
libpq Red Hat:rhel_aus:8.2::appstream | All versions | 0:12.7-1.el8_2.3 |
libpq-debuginfo Red Hat:rhel_aus:8.2::appstream | All versions | 0:12.7-1.el8_2.3 |
libpq-debugsource Red Hat:rhel_aus:8.2::appstream | All versions | 0:12.7-1.el8_2.3 |
libpq-devel Red Hat:rhel_aus:8.2::appstream | All versions | 0:12.7-1.el8_2.3 |
libpq-devel-debuginfo Red Hat:rhel_aus:8.2::appstream | All versions | 0:12.7-1.el8_2.3 |
libpq Red Hat:rhel_aus:8.4::appstream | All versions | 0:13.23-1.el8_4 |
libpq-debuginfo Red Hat:rhel_aus:8.4::appstream | All versions | 0:13.23-1.el8_4 |
libpq-debugsource Red Hat:rhel_aus:8.4::appstream | All versions | 0:13.23-1.el8_4 |
libpq-devel Red Hat:rhel_aus:8.4::appstream | All versions | 0:13.23-1.el8_4 |
libpq-devel-debuginfo Red Hat:rhel_aus:8.4::appstream | All versions | 0:13.23-1.el8_4 |
libpq Red Hat:rhel_aus:8.6::appstream | All versions | 0:13.23-1.el8_6 |
libpq-debuginfo Red Hat:rhel_aus:8.6::appstream | All versions | 0:13.23-1.el8_6 |
How do I fix CVE-2025-12818?
Upgrade postgresql to a fixed version for your release line: 13.23.0, 14.20.0, 15.15.0 or 16.11.0.
Is CVE-2025-12818 being exploited?
There is no known exploitation of CVE-2025-12818 in the wild and no public exploit code.
Sources
Also known as ALPINE-CVE-2025-12818, ALSA-2026:0458, ALSA-2026:0525, ALSA-2026:0594, ALSA-2026:0695, AZL-70166 and 34 more.