CVE-2022-0391
Python vulnerability analysis and mitigation

Overview

A security vulnerability (CVE-2022-0391) was discovered in Python's urllib.parse module, which helps break Uniform Resource Locator (URL) strings into components. The vulnerability was disclosed on February 9, 2022, affecting Python versions prior to 3.10.0b1, 3.9.5, 3.8.11, 3.7.11, and 3.6.14. The issue involves the urlparse method's failure to sanitize input, specifically allowing characters like '\r' and '\n' in the URL path (Ubuntu CVE, Debian Tracker).

Technical details

The vulnerability exists in the urllib.parse module's handling of URL parsing. The core issue lies in the urlparse method's inability to properly sanitize input containing ASCII newline ('\r', '\n') and tab characters in URL paths. According to the WHATWG URL specification, these characters should be stripped from the input during URL parsing. The vulnerability received a CVSS 3.1 base score of 7.5 (High), with the vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N (Ubuntu CVE).

Impact

The vulnerability allows attackers to input crafted URLs that could lead to injection attacks. The successful exploitation of this vulnerability could result in the addition or modification of data. The CVSS scoring indicates that while there is no impact on confidentiality or availability, there is a high impact on integrity (NetApp Advisory).

Mitigation and workarounds

The vulnerability has been fixed in Python versions 3.10.0b1, 3.9.5, 3.8.11, 3.7.11, and 3.6.14. Various Linux distributions and software vendors have released patches for their affected products. For example, Debian has fixed this in version 2.7.16-2+deb10u3 for Python 2.7, and Ubuntu has provided fixes across multiple Python versions (Debian LTS, Ubuntu CVE).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-6237CRITICAL9.8
  • PythonPython
  • invokeai
NoNoSep 18, 2025
CVE-2025-10157CRITICAL9.3
  • PythonPython
  • picklescan
NoYesSep 17, 2025
CVE-2025-10156CRITICAL9.3
  • PythonPython
  • picklescan
NoYesSep 17, 2025
CVE-2025-9906HIGH8.6
  • PythonPython
  • keras
NoYesSep 19, 2025
CVE-2025-9905HIGH7.3
  • PythonPython
  • keras
NoYesSep 19, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management