# CVE-2025-0938: URL parser allowed square brackets in domain names

> Python's URL parser incorrectly accepted square brackets in domain names, potentially causing differential parsing issues compared to compliant parsers.

- **Severity:** Medium 6.3 (`CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Jan 2025
- **Updated:** 31 Jul 2026
- **Also known as:** ALPINE-CVE-2025-0938, ALSA-2025:6977, ALSA-2025:7107, ALSA-2025:7109, ALSA-2026:5588, AZL-56231, AZL-56343, BELL-CVE-2025-0938, BIT-libpython-2025-0938, BIT-python-2025-0938, BIT-python-min-2025-0938, CLEANSTART-2026-HG22409, CLSA-2026-1767629333, CLSA-2026-1767800092, CLSA-2026-1767800687, DEBIAN-CVE-2025-0938, ECHO-2b3d-4ba9-189d, GHSA-5qjr-cj9f-phrx, MINI-4793-rxpp-vxmp, MINI-4f3m-r4r7-7c3h, MINI-grf7-9fgw-pmm3, MINI-x6fh-v5m5-v96x, OESA-2025-1148, OESA-2025-1149, OESA-2025-1150, OESA-2025-1151, PSF-2025-1, RHSA-2025:6977, RHSA-2025:7107, RHSA-2025:7109, RHSA-2026:5588, RLSA-2025:6977, RLSA-2025:7107, RLSA-2025:7109, SUSE-SU-2025:0386-1, SUSE-SU-2025:0406-1, SUSE-SU-2025:0419-1, SUSE-SU-2025:0434-1, SUSE-SU-2025:0502-1, SUSE-SU-2025:0514-1, SUSE-SU-2025:0551-1, SUSE-SU-2025:0552-1, SUSE-SU-2025:0553-1, SUSE-SU-2025:0554-1, SUSE-SU-2025:0756-1, SUSE-SU-2025:0814-1, SUSE-SU-2025:20346-1, UBUNTU-CVE-2025-0938, USN-7280-1, USN-7280-2, USN-7348-2, openSUSE-SU-2025:14750-1, openSUSE-SU-2025:14751-1, openSUSE-SU-2025:14758-1, openSUSE-SU-2025:14759-1, openSUSE-SU-2025:14760-1, openSUSE-SU-2025:14761-1

## What is CVE-2025-0938?

CVE-2025-0938 is a medium-severity vulnerability in CPython, published on 31 Jan 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The Python standard library functions `urllib.parse.urlsplit` and `urlparse` accepted domain names that included square brackets which isn't valid according to RFC 3986. Square brackets are only meant to be used as delimiters for specifying IPv6 and IPvFuture hosts in URLs. This could result in differential parsing across the Python URL parser and other specification-compliant URL parsers.

Weakness: CWE-20 (Improper Input Validation)

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

3 open source packages ship an affected version, including libpython, python and python-min.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.9.22, 3.10.17, 3.11.12, 3.12.9, 3.13.2 |
| `python` | Bitnami | All versions | 3.9.22, 3.10.17, 3.11.12, 3.12.9, 3.13.2 |
| `python-min` | Bitnami | All versions | 3.9.22, 3.10.17, 3.11.12, 3.12.9, 3.13.2 |
| `platform-python` | AlmaLinux:8 | All versions | 3.6.8-74.el8_10.alma.1 |
| `platform-python-debug` | AlmaLinux:8 | All versions | 3.6.8-74.el8_10.alma.1 |
| `platform-python-devel` | AlmaLinux:8 | All versions | 3.6.8-74.el8_10.alma.1 |
| `python3-idle` | AlmaLinux:8 | All versions | 3.6.8-74.el8_10.alma.1 |
| `python3-libs` | AlmaLinux:8 | All versions | 3.6.8-74.el8_10.alma.1 |
| `python3-test` | AlmaLinux:8 | All versions | 3.6.8-74.el8_10.alma.1 |
| `python3-tkinter` | AlmaLinux:8 | All versions | 3.6.8-74.el8_10.alma.1 |
| `python-unversioned-command` | AlmaLinux:9 | All versions | 3.9.21-2.el9 |
| `python3` | AlmaLinux:9 | All versions | 3.9.21-2.el9 |
| `python3-debug` | AlmaLinux:9 | All versions | 3.9.21-2.el9 |
| `python3-devel` | AlmaLinux:9 | All versions | 3.9.21-2.el9 |
| `python3-idle` | AlmaLinux:9 | All versions | 3.9.21-2.el9 |
| `python3-libs` | AlmaLinux:9 | All versions | 3.9.21-2.el9 |
| `python3-test` | AlmaLinux:9 | All versions | 3.9.21-2.el9 |
| `python3-tkinter` | AlmaLinux:9 | All versions | 3.9.21-2.el9 |
| `python3.11` | AlmaLinux:9 | All versions | 3.11.11-2.el9 |
| `python3.11-debug` | AlmaLinux:9 | All versions | 3.11.11-2.el9 |
| `python3.11-devel` | AlmaLinux:9 | All versions | 3.11.11-2.el9 |
| `python3.11-idle` | AlmaLinux:9 | All versions | 3.11.11-2.el9 |
| `python3.11-libs` | AlmaLinux:9 | All versions | 3.11.11-2.el9 |
| `python3.11-test` | AlmaLinux:9 | All versions | 3.11.11-2.el9 |
| `python3.11-tkinter` | AlmaLinux:9 | All versions | 3.11.11-2.el9 |
| `python3.12` | AlmaLinux:9 | All versions | 3.12.9-1.el9 |
| `python3.12-debug` | AlmaLinux:9 | All versions | 3.12.9-1.el9 |
| `python3.12-devel` | AlmaLinux:9 | All versions | 3.12.9-1.el9 |
| `python3.12-idle` | AlmaLinux:9 | All versions | 3.12.9-1.el9 |
| `python3.12-libs` | AlmaLinux:9 | All versions | 3.12.9-1.el9 |
| `python3.12-test` | AlmaLinux:9 | All versions | 3.12.9-1.el9 |
| `python3.12-tkinter` | AlmaLinux:9 | All versions | 3.12.9-1.el9 |
| `platform-python` | Red Hat:enterprise_linux:8::appstream | All versions | 0:3.6.8-74.el8_10 |
| `platform-python-debug` | Red Hat:enterprise_linux:8::appstream | All versions | 0:3.6.8-74.el8_10 |
| `platform-python-devel` | Red Hat:enterprise_linux:8::appstream | All versions | 0:3.6.8-74.el8_10 |
| `python3-debuginfo` | Red Hat:enterprise_linux:8::appstream | All versions | 0:3.6.8-74.el8_10 |
| `python3-debugsource` | Red Hat:enterprise_linux:8::appstream | All versions | 0:3.6.8-74.el8_10 |
| `python3-idle` | Red Hat:enterprise_linux:8::appstream | All versions | 0:3.6.8-74.el8_10 |
| `python3-test` | Red Hat:enterprise_linux:8::appstream | All versions | 0:3.6.8-74.el8_10 |
| `python3-tkinter` | Red Hat:enterprise_linux:8::appstream | All versions | 0:3.6.8-74.el8_10 |

## How do I fix CVE-2025-0938?

Upgrade libpython to a fixed version for your release line: 3.9.22, 3.10.17, 3.11.12 or 3.12.9.

## Is CVE-2025-0938 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2025-0938 is a medium-severity vulnerability in CPython, published on 31 Jan 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-0938 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.9.22, 3.10.17, 3.11.12, 3.12.9, 3.13.2
- python (Bitnami): affected all versions; fixed in 3.9.22, 3.10.17, 3.11.12, 3.12.9, 3.13.2
- python-min (Bitnami): affected all versions; fixed in 3.9.22, 3.10.17, 3.11.12, 3.12.9, 3.13.2

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-0938/ (Markdown: https://insights.sbomify.com/CVE-2025-0938/index.md)
```

## Sources

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

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