Web Cache Poisoning Vulnerability in python/cpython
Summary
CVE-2021-23336: The package python/cpython from 0 and before 3.6.13, from 3.7.0 and before 3.7.10, from 3.8.0 and before 3.8.8, from 3.9.0 and before 3.9.2 are vulnerable to Web Cache Poisoning via urllib.parse.parse_qsl and urllib.pars... Affects python3 across 3 version ranges.
< 3.8.8-r0
>= 635d53a86a36cde7866b9caefeb64d809e6bfcd9, < 21a5547793a24357a985390970b489aeeca06d45
< aa73e1722eb9835dc99fd8983885a141112ee4ab
Fixed in 3.8.8-r0. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
The python/cpython package is a widely used open-source implementation of the Python programming language. It provides a comprehensive set of libraries and tools for developing Python applications. This vulnerability affects versions 0 to 3.6.13, 3.7.0 to 3.7.10, 3.8.0 to 3.8.8, and 3.9.0 to 3.9.2. The vulnerability specifically impacts the urllib.parse.parse_qsl and urllib.parse.parse_qs functions, which are used for parsing query strings. By exploiting a technique called parameter cloaking, an attacker can manipulate query parameters using a semicolon (;) to cause a difference in interpretation between the proxy and the server. This can lead to malicious requests being cached as safe ones, potentially bypassing security measures.
Vulnerability Detail
The Web Cache Poisoning vulnerability in python/cpython arises due to the improper handling of query parameters by the urllib.parse.parse_qsl and urllib.parse.parse_qs functions. When an attacker separates query parameters using a semicolon (;), it can result in a discrepancy in how the proxy and the server interpret the request. The proxy, by default, does not consider the semicolon as a separator and may cache the malicious request as a safe one. This can lead to the execution of unauthorized actions or the exposure of sensitive information. The vulnerability has a CVSS score of 5.9, indicating a moderate severity level.
How To Fix
Minimum fixed version
3.8.8-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
There is no known workaround for this vulnerability. It is essential to update the python/cpython package to the latest patched version to address the issue effectively.
Conclusion
The Web Cache Poisoning vulnerability in python/cpython exposes applications to the risk of unauthorized actions and information exposure. It is crucial to update to the latest patched version of the package (3.8.8 or later) to mitigate this vulnerability. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for python3 →
FAQ
Python/cpython is an open-source implementation of the Python programming language. It provides a comprehensive set of libraries and tools for developing Python applications.
The vulnerability occurs due to the improper handling of query parameters in the urllib.parse module. By using a semicolon (;) to separate query parameters, an attacker can manipulate the interpretation of the request between the proxy and the server.
The vulnerability can allow an attacker to execute unauthorized actions or expose sensitive information by poisoning the web cache. This can lead to various security risks, including data breaches and unauthorized access to protected resources.
Yes, the python/cpython package has released a patched version (3.8.8 or later) that addresses the vulnerability. It is recommended to update to the latest version to mitigate the risk.
No, there are no known workarounds for this vulnerability. Updating to the patched version of the python/cpython package is the recommended solution.
Related vulnerabilities
Recent vulnerabilities recorded for python3.