CVE-2025-4207 PostgreSQL GB18030 encoding validation can read one byte past end of allocation for text that fails validation

Medium 5.9 Published Updated

A buffer over-read in PostgreSQL's GB18030 encoding validation can cause a denial of service by terminating the process.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-4207?

CVE-2025-4207 is a medium-severity denial of service vulnerability in PostgreSQL, published on 8 May 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-126

Which versions are affected by CVE-2025-4207?

1 open source package ship an affected version, including postgresql.

PackageAffectedFixed in
postgresql BitnamiAll versions13.21.0, 14.18.0, 15.13.0, 16.9.0, 17.5.0
Linux distribution packages (39)
postgresql13 SUSE:Enterprise Storage 7.1All versions13.21-150200.5.72.1
postgresql14 SUSE:Enterprise Storage 7.1All versions14.18-150200.5.58.1
postgresql15 SUSE:Enterprise Storage 7.1All versions15.13-150200.5.41.1
postgresql16 SUSE:Enterprise Storage 7.1All versions16.9-150200.5.29.1
postgresql17 SUSE:Enterprise Storage 7.1All versions17.5-150200.5.13.1
postgresql13 SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSAll versions13.21-150200.5.72.1
postgresql14 SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSAll versions14.18-150200.5.58.1
postgresql15 SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSAll versions15.13-150200.5.41.1
postgresql16 SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSAll versions16.9-150200.5.29.1
postgresql17 SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSAll versions17.5-150200.5.13.1
postgresql13 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions13.21-150200.5.72.1
postgresql14 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions14.18-150200.5.58.1
postgresql15 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions15.13-150200.5.41.1
postgresql16 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions16.9-150200.5.29.1
postgresql17 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions17.5-150200.5.13.1
postgresql13 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions13.21-150200.5.72.1
postgresql14 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions14.18-150200.5.58.1
postgresql15 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions15.13-150200.5.41.1
postgresql16 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions16.9-150200.5.29.1
postgresql17 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions17.5-150200.5.13.1
postgresql15 SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOSAll versions15.13-150200.5.41.1
postgresql16 SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOSAll versions16.9-150200.5.29.1
postgresql17 SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOSAll versions17.5-150200.5.13.1
postgresql15 SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSSAll versions15.13-150200.5.41.1
postgresql16 SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSSAll versions16.9-150200.5.29.1
postgresql17 SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSSAll versions17.5-150200.5.13.1
postgresql16 SUSE:Linux Enterprise Module for Basesystem 15 SP6All versions16.9-150600.16.18.1
postgresql17 SUSE:Linux Enterprise Module for Basesystem 15 SP6All versions17.5-150600.13.13.1
postgresql17 SUSE:Linux Enterprise Module for Basesystem 15 SP7All versions17.5-150600.13.13.1
postgresql14 SUSE:Linux Enterprise Module for Legacy 15 SP6All versions14.18-150600.16.17.1
postgresql15 SUSE:Linux Enterprise Module for Legacy 15 SP6All versions15.13-150600.16.17.1
postgresql15 SUSE:Linux Enterprise Module for Legacy 15 SP7All versions15.13-150600.16.17.1
postgresql16 SUSE:Linux Enterprise Module for Legacy 15 SP7All versions16.9-150600.16.18.1
postgresql14 SUSE:Linux Enterprise Module for Package Hub 15 SP3All versions14.18-150200.5.58.1
postgresql14 SUSE:Linux Enterprise Module for Package Hub 15 SP4All versions14.18-150200.5.58.1
postgresql16 SUSE:Linux Enterprise Module for Package Hub 15 SP4All versions16.9-150200.5.29.1
postgresql14 SUSE:Linux Enterprise Module for Package Hub 15 SP5All versions14.18-150200.5.58.1
postgresql16 SUSE:Linux Enterprise Module for Package Hub 15 SP5All versions16.9-150200.5.29.1
postgresql17 SUSE:Linux Enterprise Module for Package Hub 15 SP5All versions17.5-150200.5.13.1

How do I fix CVE-2025-4207?

Upgrade postgresql to a fixed version for your release line: 13.21.0, 14.18.0, 15.13.0 or 16.9.0.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2025-4207 being exploited?

There is no known exploitation of CVE-2025-4207 in the wild and no public exploit code.

Sources

Also known as ALPINE-CVE-2025-4207, AZL-61736, AZL-61739, AZL-74894, BELL-CVE-2025-4207, BIT-postgresql-2025-4207 and 51 more.

Is CVE-2025-4207 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free