CVE-2025-0938: CWE-20 Improper Input Validation in Python Software Foundation CPython
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.
AI Analysis
Technical Summary
The vulnerability arises from improper input validation in CPython's URL parsing functions `urllib.parse.urlsplit` and `urlparse`. They accept domain names with square brackets, violating RFC 3986, which restricts square brackets to IPv6 and IPvFuture host delimiters. This discrepancy can lead to inconsistent URL parsing results when Python applications interact with other systems or libraries that strictly follow the RFC. The affected CPython versions include 0, 3.11.0, 3.12.0, 3.13.0, and 3.14.0a1. The CVSS 4.0 score is 6.3, indicating medium severity.
Potential Impact
The improper input validation may cause differential parsing of URLs between Python and other parsers compliant with RFC 3986. This could potentially lead to logic errors or security issues in applications relying on Python's URL parsing, such as incorrect host resolution or bypassing security controls that depend on consistent URL interpretation. No known exploits are reported in the wild at this time.
Mitigation Recommendations
Patch status is not yet confirmed — check the Python Software Foundation advisory for current remediation guidance. Until a fix is available, developers should validate and sanitize URL inputs externally before passing them to Python's URL parsing functions to ensure compliance with RFC 3986.
CVE-2025-0938: CWE-20 Improper Input Validation in Python Software Foundation CPython
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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability arises from improper input validation in CPython's URL parsing functions `urllib.parse.urlsplit` and `urlparse`. They accept domain names with square brackets, violating RFC 3986, which restricts square brackets to IPv6 and IPvFuture host delimiters. This discrepancy can lead to inconsistent URL parsing results when Python applications interact with other systems or libraries that strictly follow the RFC. The affected CPython versions include 0, 3.11.0, 3.12.0, 3.13.0, and 3.14.0a1. The CVSS 4.0 score is 6.3, indicating medium severity.
Potential Impact
The improper input validation may cause differential parsing of URLs between Python and other parsers compliant with RFC 3986. This could potentially lead to logic errors or security issues in applications relying on Python's URL parsing, such as incorrect host resolution or bypassing security controls that depend on consistent URL interpretation. No known exploits are reported in the wild at this time.
Mitigation Recommendations
Patch status is not yet confirmed — check the Python Software Foundation advisory for current remediation guidance. Until a fix is available, developers should validate and sanitize URL inputs externally before passing them to Python's URL parsing functions to ensure compliance with RFC 3986.
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- PSF
- Date Reserved
- 2025-01-31T17:45:10.107Z
- Cisa Enriched
- true
Threat ID: 682d983ec4522896dcbf00a0
Added to database: 5/21/2025, 9:09:18 AM
Last enriched: 4/22/2026, 5:44:37 AM
Last updated: 5/9/2026, 10:27:32 PM
Views: 110
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.