CWE-126Weakness · CWE-126

CVE-2025-4207

MEDIUM · 5.9 CVSS v3.1 Published 2025-05-08
Mitigation only
No fix yet — a mitigation exists. There is no fixed release. A documented workaround reduces exposure in the meantime.
See remediation →
68/100
Remediation priority · Elevated
Remotely reachable No privileges Zero-click

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 · unedited
Buffer 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 confidence

Buffer 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.

MitigationUpgrade 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.

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 checks

Work through these to decide whether this CVE applies to you.

  1. Confirm GB18030 encoding is in use
    Check 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
  2. Identify PostgreSQL server version
    Run 'SELECT version();' or 'psql --version' from command line to obtain the installed PostgreSQL server version
    Affected if Version is earlier than the patched releases (17.5, 16.9, 15.13, 14.18, 13.21) and GB18030 encoding is used
  3. Check if libpq is loaded and its version
    For 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 libpq
    Affected if libpq version is earlier than the patched releases and client applications connect to PostgreSQL servers using GB18030 encoding
  4. Verify application uses libpq for connections
    Review 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 method
    Affected if Application links against libpq and connects to servers that may use GB18030 encoding
  5. Detect active GB18030-encoded connections
    Query 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.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

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 · scoped
Mitigation available No clean upgrade yet — mitigate in the meantime
Mitigation

Upgrade 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.

Recommended fix High confidence

PostgreSQL 17.5, 16.9, 15.13, 14.18, or 13.21 (depending on your current major version)

  1. 1. Identify the current PostgreSQL version by running: psql --version or SELECT version();
  2. 2. Determine which major version line you are currently running (13, 14, 15, 16, or 17)
  3. 3. For production databases, create a full backup before upgrading: pg_dumpall > backup.sql
  4. 4. Stop the PostgreSQL service: sudo systemctl stop postgresql (or equivalent for your system)
  5. 5. Upgrade to the fixed version for your release line: 17.5, 16.9, 15.13, 14.18, or 13.21
  6. 6. On Debian/Ubuntu: sudo apt-get update && sudo apt-get install postgresql (or postgresql-XX for specific version)
  7. 7. On RHEL/CentOS: sudo yum update postgresql or sudo dnf update postgresql
  8. 8. Start the PostgreSQL service: sudo systemctl start postgresql
Caveat Minor version upgrades within the same major version are generally safe; major version upgrades (e.g., 16 to 17) may require pg_dump/restore and can have compatibility changes - review PostgreSQL release notes for breaking changes

Generated from the published advisory — verify against the referenced sources before acting.

Have this fixed Scoped from the published advisory
  • Consultation3.0 h
  • Implementation4.0 h
  • Testing6.0 h
  • Review / QA3.0 h
16.0 hours of engineering $2,760
Get help mitigating

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 locally
dbcve dependency scanner

Check 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 sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2025-4207 in production — separate from our analysis above.

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.

What this is

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.

What belongs here
  • 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