CVE-2025-4207
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 · uneditedBuffer over-read in PostgreSQL GB18030 encoding validation allows a database input provider to achieve temporary denial of service on platforms where a 1-byte over-read can elicit process termination. This affects the database server and also libpq. Versions before PostgreSQL 17.5, 16.9, 15.13, 14.18, and 13.21 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 confidenceBuffer over-read vulnerability in PostgreSQL's GB18030 encoding validation. The validation logic reads one byte beyond the allocated buffer when processing GB18030-encoded input. On platforms where this causes process termination (typically due to memory protection), it results in temporary denial of service. Both the PostgreSQL server and the libpq client library are affected.
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.
-
Confirm GB18030 encoding is in useCheck PostgreSQL client_encoding or server encoding settings: SHOW client_encoding; SHOW server_encoding; or inspect pg_database for encoding of active databases: SELECT datname, encoding FROM pg_database;Affected if GB18030 is set as client or server encoding, or any database uses GB18030 encoding
-
Identify PostgreSQL server versionRun 'SELECT version();' or 'psql --version' from command line to obtain the installed PostgreSQL server versionAffected if Version is earlier than the patched releases (17.5, 16.9, 15.13, 14.18, 13.21) and GB18030 encoding is used
-
Check if libpq is loaded and its versionFor connected clients: ldd (path_to_psql) | grep libpq, or check the libpq version file if available: rpm -q libpq or dpkg -l libpq, or inspect the library directly: psql --version for psql client which links to libpqAffected if libpq version is earlier than the patched releases and client applications connect to PostgreSQL servers using GB18030 encoding
-
Verify application uses libpq for connectionsReview application dependencies: check for libpq.so in application runtime, or inspect application binary with ldd (Linux) or otool (macOS), or review application documentation for PostgreSQL connection methodAffected if Application links against libpq and connects to servers that may use GB18030 encoding
-
Detect active GB18030-encoded connectionsQuery pg_stat_activity for client_enantcoding: SELECT pid, usename, client_encoding, query FROM pg_stat_activity WHERE client_encoding = 'GB18030';Affected if Any active session shows GB18030 as client_encoding while running on an unpatched PostgreSQL version
User is affected if GB18030 encoding is enabled in PostgreSQL (server or client) AND the installed PostgreSQL server or libpq version predates the patched releases.
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 to version 17.5, 16.9, 15.13, 14.18, 13.21 or later. For libpq, ensure any deployed client applications use the updated library version.
PostgreSQL 17.5, 16.9, 15.13, 14.18, or 13.21 (depending on your current major version)
- 1. Identify the current PostgreSQL version by running: psql --version or SELECT version();
- 2. Determine which major version line you are currently running (13, 14, 15, 16, or 17)
- 3. For production databases, create a full backup before upgrading: pg_dumpall > backup.sql
- 4. Stop the PostgreSQL service: sudo systemctl stop postgresql (or equivalent for your system)
- 5. Upgrade to the fixed version for your release line: 17.5, 16.9, 15.13, 14.18, or 13.21
- 6. On Debian/Ubuntu: sudo apt-get update && sudo apt-get install postgresql (or postgresql-XX for specific version)
- 7. On RHEL/CentOS: sudo yum update postgresql or sudo dnf update postgresql
- 8. Start the PostgreSQL service: sudo systemctl start postgresql
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation3.0 h
- Implementation4.0 h
- Testing6.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 $4,416.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-4207 — 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-4207 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