CVE-2025-12818
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.
| Package | Ecosystem | Fixed in |
|---|---|---|
| postgresql17-private-libs | Amazon Linux | 17.7-1.amzn2023.0.1 |
| postgresql18 | Alpine | 18.1-r0 |
| postgresql15-test-rpm-macros | Amazon Linux | 15.15-1.amzn2023.0.1 |
| postgresql17-static | Amazon Linux | 17.7-1.amzn2023.0.1 |
| postgresql17-test | Amazon Linux | 17.7-1.amzn2023.0.1 |
| postgresql16-plpython3 | Amazon Linux | 16.11-1.amzn2023.0.1 |
| postgresql17-plpython3 | Amazon Linux | 17.7-1.amzn2023.0.1 |
| postgresql15-plperl | Amazon Linux | 15.15-1.amzn2023.0.1 |
| postgresql15 | Alpine | 15.15-r0 |
| postgresql17-private-devel | Amazon Linux | 17.7-1.amzn2023.0.1 |
| postgresql15-upgrade | Amazon Linux | 15.15-1.amzn2023.0.1 |
| postgresql16-contrib | Amazon Linux | 16.11-1.amzn2023.0.1 |
45 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | PostgreSQL | 18, 17, 16 |
| n/a | PostgreSQL | 18, 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