CVE Program
CNA-CVE-2025-0938
URL parser allowed square brackets in domain names
Details
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.
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| Python | python | All versions before 3.9.22 (fixed in 3.9.22) From 3.10.0 before 3.10.17 (fixed in 3.10.17) From 3.11.0 before 3.11.12 (fixed in 3.11.12) From 3.12.0 before 3.12.9 (fixed in 3.12.9) From 3.13.0 before 3.13.2 (fixed in 3.13.2) From 3.14.0a1 before 3.14.0a5 (fixed in 3.14.0a5) |
References
- https://www.cve.org/CVERecord?id=CVE-2025-0938
- https://github.com/python/cpython/issues/105704
- https://github.com/python/cpython/pull/129418
- https://mail.python.org/archives/list/[email protected]/thread/K4EUG6EKV6JYFIC24BASYOZS4M5XOQIB/
- https://github.com/python/cpython/commit/d89a5f6a6e65511a5f6e0618c4c30a7aa5aba56a
- https://github.com/python/cpython/commit/90e526ae67b172ed7c6c56e7edad36263b0f9403
- https://github.com/python/cpython/commit/a7084f6075c9595ba60119ce8c62f1496f50c568
- https://github.com/python/cpython/commit/526617ed68cde460236c973e5d0a8bad4de896ba
- https://github.com/python/cpython/commit/b8b4b713c5f8ec0958c7ef8d29d6711889bc94ab
- https://github.com/python/cpython/commit/ff4e5c25666f63544071a6b075ae8b25c98b7a32