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

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

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 8 May 2025
- **Updated:** 9 May 2025
- **Also known as:** ALPINE-CVE-2025-4207, AZL-61736, AZL-61739, AZL-74894, BELL-CVE-2025-4207, BIT-postgresql-2025-4207, CLEANSTART-2026-PL37592, CLSA-2025-1759784438, DEBIAN-CVE-2025-4207, DLA-4159-1, ECHO-c79e-efec-fddc, GHSA-6x46-2273-xjjf, MGASA-2025-0155, MINI-25hv-9w8p-jmm4, MINI-hvqf-q89v-frg3, MINI-p848-mh93-mjvc, MINI-rfph-rqg7-44c9, MINI-w5vq-phh9-vj94, OESA-2025-1508, OESA-2025-1565, OESA-2025-1566, OESA-2025-1567, OESA-2025-1568, OESA-2025-1697, OESA-2025-1698, OESA-2025-1699, OESA-2025-1700, SUSE-SU-2025:01644-1, SUSE-SU-2025:01644-2, SUSE-SU-2025:01654-1, SUSE-SU-2025:01661-1, SUSE-SU-2025:01661-2, SUSE-SU-2025:01705-1, SUSE-SU-2025:01748-1, SUSE-SU-2025:01748-2, SUSE-SU-2025:01749-1, SUSE-SU-2025:01750-1, SUSE-SU-2025:01765-1, SUSE-SU-2025:01766-1, SUSE-SU-2025:01766-2, SUSE-SU-2025:01767-1, SUSE-SU-2025:01772-1, SUSE-SU-2025:01782-1, SUSE-SU-2025:01782-2, SUSE-SU-2025:01783-1, SUSE-SU-2025:01783-2, SUSE-SU-2025:01785-1, SUSE-SU-2025:01786-1, SUSE-SU-2025:01786-2, UBUNTU-CVE-2025-4207, USN-7520-1, USN-7520-2, openSUSE-SU-2025:15137-1, openSUSE-SU-2025:15138-1, openSUSE-SU-2025:15139-1, openSUSE-SU-2025:15140-1, openSUSE-SU-2025:15151-1

## 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 (Buffer Over-read)

## Which versions are affected by CVE-2025-4207?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `postgresql` | Bitnami | All versions | 13.21.0, 14.18.0, 15.13.0, 16.9.0, 17.5.0 |
| `postgresql13` | SUSE:Enterprise Storage 7.1 | All versions | 13.21-150200.5.72.1 |
| `postgresql14` | SUSE:Enterprise Storage 7.1 | All versions | 14.18-150200.5.58.1 |
| `postgresql15` | SUSE:Enterprise Storage 7.1 | All versions | 15.13-150200.5.41.1 |
| `postgresql16` | SUSE:Enterprise Storage 7.1 | All versions | 16.9-150200.5.29.1 |
| `postgresql17` | SUSE:Enterprise Storage 7.1 | All versions | 17.5-150200.5.13.1 |
| `postgresql13` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 13.21-150200.5.72.1 |
| `postgresql14` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 14.18-150200.5.58.1 |
| `postgresql15` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 15.13-150200.5.41.1 |
| `postgresql16` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 16.9-150200.5.29.1 |
| `postgresql17` | SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 17.5-150200.5.13.1 |
| `postgresql13` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 13.21-150200.5.72.1 |
| `postgresql14` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 14.18-150200.5.58.1 |
| `postgresql15` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 15.13-150200.5.41.1 |
| `postgresql16` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 16.9-150200.5.29.1 |
| `postgresql17` | SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 17.5-150200.5.13.1 |
| `postgresql13` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 13.21-150200.5.72.1 |
| `postgresql14` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 14.18-150200.5.58.1 |
| `postgresql15` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 15.13-150200.5.41.1 |
| `postgresql16` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 16.9-150200.5.29.1 |
| `postgresql17` | SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 17.5-150200.5.13.1 |
| `postgresql15` | SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 15.13-150200.5.41.1 |
| `postgresql16` | SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 16.9-150200.5.29.1 |
| `postgresql17` | SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | All versions | 17.5-150200.5.13.1 |
| `postgresql15` | SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 15.13-150200.5.41.1 |
| `postgresql16` | SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 16.9-150200.5.29.1 |
| `postgresql17` | SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | All versions | 17.5-150200.5.13.1 |
| `postgresql16` | SUSE:Linux Enterprise Module for Basesystem 15 SP6 | All versions | 16.9-150600.16.18.1 |
| `postgresql17` | SUSE:Linux Enterprise Module for Basesystem 15 SP6 | All versions | 17.5-150600.13.13.1 |
| `postgresql17` | SUSE:Linux Enterprise Module for Basesystem 15 SP7 | All versions | 17.5-150600.13.13.1 |
| `postgresql14` | SUSE:Linux Enterprise Module for Legacy 15 SP6 | All versions | 14.18-150600.16.17.1 |
| `postgresql15` | SUSE:Linux Enterprise Module for Legacy 15 SP6 | All versions | 15.13-150600.16.17.1 |
| `postgresql15` | SUSE:Linux Enterprise Module for Legacy 15 SP7 | All versions | 15.13-150600.16.17.1 |
| `postgresql16` | SUSE:Linux Enterprise Module for Legacy 15 SP7 | All versions | 16.9-150600.16.18.1 |
| `postgresql14` | SUSE:Linux Enterprise Module for Package Hub 15 SP3 | All versions | 14.18-150200.5.58.1 |
| `postgresql14` | SUSE:Linux Enterprise Module for Package Hub 15 SP4 | All versions | 14.18-150200.5.58.1 |
| `postgresql16` | SUSE:Linux Enterprise Module for Package Hub 15 SP4 | All versions | 16.9-150200.5.29.1 |
| `postgresql14` | SUSE:Linux Enterprise Module for Package Hub 15 SP5 | All versions | 14.18-150200.5.58.1 |
| `postgresql16` | SUSE:Linux Enterprise Module for Package Hub 15 SP5 | All versions | 16.9-150200.5.29.1 |
| `postgresql17` | SUSE:Linux Enterprise Module for Package Hub 15 SP5 | All versions | 17.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.

## Is CVE-2025-4207 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-4207 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2025-4207 in the wild and no public exploit code.

Affected packages and fixed versions:
- postgresql (Bitnami): affected all versions; fixed in 13.21.0, 14.18.0, 15.13.0, 16.9.0, 17.5.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-4207/ (Markdown: https://insights.sbomify.com/CVE-2025-4207/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-4207
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-4207
- OSV: https://osv.dev/vulnerability/CVE-2025-4207

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-4207/
Summaries are generated and may contain mistakes; the official description above is the record.
