CVE-2025-0938

URL parser allowed square brackets in domain names

Published Jan 31, 2025 CVSS 4.0 · 6.3 Medium EPSS 1.5% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

A flaw in Python’s urllib.parse.urlsplit and urlparse accepts domain names containing square brackets, which are not permitted by RFC 3986 except as delimiters for IPv6 or IPvFuture addresses. This improper input validation causes URLs to be parsed differently by Python than by other compliant parsers, potentially exposing applications to security‑sensitive logic errors such as incorrect hostname verification or unauthorized redirects. The CWE‑20 designation confirms the issue is an input validation flaw.

Affected Systems

The defect resides in CPython, the reference implementation of Python produced by the Python Software Foundation. Any deployment of CPython that uses the affected urllib.parse functions—such as applications and services built against older Python releases—may be impacted. Red Hat Enterprise Linux 9 and related packages that ship Python, as indicated by the supplied CPE identifiers, are therefore also covered.

Risk and Exploitability

The CVSS score of 6.3 indicates moderate severity, while the EPSS score of 1 % suggests a low likelihood of exploitation at the time of assessment and the vulnerability is not listed in CISA’s KEV catalog. The likely attack vector is an attacker who can supply a crafted URL containing square brackets in a domain name to an application that passes it directly to urllib.parse. Because the parsing error creates a mismatch between the hostname seen by Python and that seen by other parsers, a malicious user could potentially bypass hostname checks or redirect logic, facilitating phishing or other logic‑bypass attacks. This inference is deduced from the description and the nature of the flaw, as the CVE text does not explicitly describe an exploitation path.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to the latest CPython release that contains the urllib.parse fix
  • Validate that host components of URLs do not contain '[' or ']' unless they are part of an IPv6 or IPvFuture literal before calling urllib.parse
  • Implement tests to ensure that URL parsing behaves consistently with RFC 3986 when processing user‑supplied URLs

Generated by OpenCVE AI on April 22, 2026 at 12:11 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4087-1 python3.9 security update
Debian DLA Debian DLA DLA-4354-1 pypy3 security update
EUVD EUVD EUVD-2025-1935 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.
Ubuntu USN Ubuntu USN USN-7280-1 Python vulnerability
Ubuntu USN Ubuntu USN USN-7280-2 Python vulnerability
Ubuntu USN Ubuntu USN USN-7280-3 Python 2.7 regression
Ubuntu USN Ubuntu USN USN-7348-1 Python vulnerabilities
Ubuntu USN Ubuntu USN USN-7348-2 Python regression
History
Type Values Removed Values Added
Metrics epss

{'score': 0.00624}

epss

{'score': 0.00637}

Type Values Removed Values Added
Metrics epss

{'score': 0.00633}

epss

{'score': 0.00624}

Type Values Removed Values Added
First Time appeared Redhat discovery
CPEs cpe:/a:redhat:discovery:1.14::el9
Vendors & Products Redhat discovery
Type Values Removed Values Added
First Time appeared Redhat
Redhat enterprise Linux
CPEs cpe:/a:redhat:enterprise_linux:9
cpe:/o:redhat:enterprise_linux:9
Vendors & Products Redhat
Redhat enterprise Linux
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.8, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title URL parser allowed square brackets in domain names
Weaknesses CWE-20
References
Metrics cvssV4_0

{'score': 6.3, 'vector': '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'}

Weaknesses
  • CWE-20

    Improper Input Validation

Sources

Status
PUBLISHED
Assigner
PSF
Published
Updated
Jul 31, 2026, 2:05 PM
Reserved
Jan 31, 2025, 5:45 PM
Status
Deferred
Published
Jan 31, 2025, 6:15 PM
Modified
Jul 31, 2026, 2:16 PM
Severity
Moderate
Public date
Jan 31, 2025, 5:51 PM