CVE-2025-12818
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedInteger 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.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceInteger wraparound in multiple libpq functions causes undersized memory allocations, leading to out-of-bounds writes of hundreds of megabytes and resulting in application segmentation faults. An attacker controlling application input or acting as a network peer can trigger this condition.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- High
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify installed libpq versionRun 'psql --version' for command-line tools, or check the shared library file: 'ls -la /usr/lib/*/libpq.so*' or 'find /usr -name "libpq*" -type f' on Linux; on Windows check the PostgreSQL bin directory for libpq.dllAffected if version is below 18.1, 17.7, 16.11, 15.15, 14.20, or 13.23 depending on your major version line
-
Identify libpq version in use by your applicationFor compiled applications: 'ldd your_application_binary | grep libpq' or 'nm your_application_binary | grep PQ' to see if it links against libpq functions. For interpreted languages: check imports or requires for psycopg, pg, or libpq bindingsAffected if application links to a vulnerable libpq version
-
Determine if application accepts network input or external dataReview application architecture: check if it connects to PostgreSQL databases over the network, accepts user queries that flow to the database, or processes remote data that could be crafted to trigger the integer wraparound in libpq functionsAffected if application uses libpq to connect to databases with untrusted input or remote connections
-
Check PostgreSQL client library package versionOn RHEL/CentOS: 'rpm -qa | grep -i libpq'. On Debian/Ubuntu: 'dpkg -l | grep -i libpq'. On macOS with Homebrew: 'brew list postgresql' and check version. On Windows: check installed PostgreSQL version in Programs and FeaturesAffected if installed package version is older than the fixed versions (18.1, 17.7, 16.11, 15.15, 14.20, 13.23)
You are affected if your application uses a libpq version older than 18.1/17.7/16.11/15.15/14.20/13.23 and accepts network input or user-controlled data that can reach database query functions.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedUpgrade PostgreSQL client libraries to version 18.1, 17.7, 16.11, 15.15, 14.20, 13.23 or later. Test applications after upgrade to ensure compatibility.
Upgrade to PostgreSQL 13.23, 14.20, 15.15, 16.11, 17.7, or 18.1 (or later in their respective branches)
- Identify the current PostgreSQL libpq version by checking your PostgreSQL client library version (psql --version or looking at libpq package)
- Determine which major version branch you are on (13, 14, 15, 16, 17, or 18)
- For PostgreSQL 13.x users: upgrade to version 13.23 or later
- For PostgreSQL 14.x users: upgrade to version 14.20 or later
- For PostgreSQL 15.x users: upgrade to version 15.15 or later
- For PostgreSQL 16.x users: upgrade to version 16.11 or later
- For PostgreSQL 17.x users: upgrade to version 17.7 or later
- For PostgreSQL 18.x users: upgrade to version 18.1 or later
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation6.0 h
- Testing8.0 h
- Review / QA3.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,472.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-12818 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-12818 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data