Vulnerability in PyPy3 and Python3: Invalid Domain Name Parsing

python3 Updated 02 Oct 2025

Summary

31/01/2025
N/A
Yes i
Unrated
Not published

CVE-2025-0938: 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. Affects python3 across 7 version ranges.

< 3.11.12-r0 < 90e526ae67b172ed7c6c56e7edad36263b0f9403 < 526617ed68cde460236c973e5d0a8bad4de896ba < a7084f6075c9595ba60119ce8c62f1496f50c568 < b8b4b713c5f8ec0958c7ef8d29d6711889bc94ab < d89a5f6a6e65511a5f6e0618c4c30a7aa5aba56a < ff4e5c25666f63544071a6b075ae8b25c98b7a32

Fixed in 3.11.12-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

PyPy3 and Python3 are popular implementations of the Python programming language, known for their performance and compatibility with Python code. They provide a wide range of libraries and functionalities, including URL parsing through the standard library. However, a recent vulnerability has been identified in the URL parsing functions, which could lead to inconsistencies in how URLs are processed, particularly those containing invalid domain names with square brackets.

Vulnerability Detail

The vulnerability arises from the Python standard library functions urllib.parse.urlsplit and urlparse, which incorrectly accept domain names that include square brackets. According to RFC 3986, square brackets are only valid as delimiters for IPv6 and IPvFuture hosts in URLs. This flaw can lead to differential parsing between the Python URL parser and other compliant URL parsers, potentially causing unexpected behavior in applications that rely on URL parsing.

How To Fix

Minimum fixed version

3.11.12-r0

This is the first release that contains the fix.

sudo apk add --upgrade python3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using URLs with square brackets in domain names until the packages can be updated. Validate and sanitize URLs before processing them in your application to prevent any potential issues.

Conclusion

The vulnerability CVE-2025-0938 poses a risk to applications using PyPy3 and Python3 due to improper URL parsing. It is crucial to update to the patched versions of the affected packages and to implement workarounds as necessary to mitigate potential issues.

See every vulnerability recorded for python3 →

Share this vulnerability

FAQ

CVE-2025-0938 is a vulnerability in the Python standard library that allows invalid domain names with square brackets to be parsed, leading to potential inconsistencies.

The affected packages include PyPy3 and various versions of Python3 (3.9, 3.11, 3.12, and 3.13) in Debian ecosystems.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Check your application against the vulnerability using the Vulert playground at Vulert Scanner.

If immediate updates are not possible, ensure to validate and sanitize URLs to avoid using those with square brackets in domain names as a temporary measure.

More detailed information can be found in the CVE database and through the official Python and PyPy documentation.

Related vulnerabilities

Recent vulnerabilities recorded for python3.

How To Fix

Minimum fixed version

3.11.12-r0

This is the first release that contains the fix.

sudo apk add --upgrade python3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback