VDB

CVE-2025-12818

CVE-2025-12818 PUBLISHED CVSS 5.9 MEDIUM

PostgreSQL libpq undersizes allocations, via integer wraparound

Reported by postgresql · Published November 13, 2025

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.

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
postgresql17-private-libsAmazon Linux17.7-1.amzn2023.0.1
postgresql18Alpine18.1-r0
postgresql15-test-rpm-macrosAmazon Linux15.15-1.amzn2023.0.1
postgresql17-staticAmazon Linux17.7-1.amzn2023.0.1
postgresql17-testAmazon Linux17.7-1.amzn2023.0.1
postgresql16-plpython3Amazon Linux16.11-1.amzn2023.0.1
postgresql17-plpython3Amazon Linux17.7-1.amzn2023.0.1
postgresql15-plperlAmazon Linux15.15-1.amzn2023.0.1
postgresql15Alpine15.15-r0
postgresql17-private-develAmazon Linux17.7-1.amzn2023.0.1
postgresql15-upgradeAmazon Linux15.15-1.amzn2023.0.1
postgresql16-contribAmazon Linux16.11-1.amzn2023.0.1

45 more packages have a fixed version. See every fix in Lookup.

Risk scores

CVSS 3.1
5.9
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected products

VendorProductVersions
n/aPostgreSQL18, 17, 16
n/aPostgreSQL18, 17, 16

Timeline

  • Nov 13, 2025 Coalition ESS Score (6 in total, the first dated here)
  • Nov 13, 2025 CVE Published
  • Nov 13, 2025 PoC Published (11 in total, the first dated here)
  • Nov 14, 2025 EPSS Score (30 in total, the first dated here)
  • Jun 2, 2026 Security Advisory (45 in total, the first dated here)
  • Oct 4, 2026 Distribution Patch (34 in total, the first dated here)

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2025-12818
vulnetix vdb fixes CVE-2025-12818

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-12818/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

References

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›