Web Cache Poisoning Vulnerability in Python Packages: CVE-2021-23336

python2.7 Updated 02 Oct 2025

Summary

15/02/2021
N/A
No i
Medium
5.9

UBUNTU-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 python2.7 versions 2.7.5-8ubuntu3 – 2.7.6-8ubuntu0.6+esm9. No fix is published. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Python is a widely-used high-level programming language known for its readability and versatility. It supports multiple programming paradigms and is commonly used for web development, data analysis, artificial intelligence, and more. The vulnerability in question affects various Python packages, specifically those utilizing the urllib.parse module, which is responsible for parsing URLs. This vulnerability allows attackers to exploit the way query parameters are handled, leading to potential cache poisoning.

Vulnerability Detail

The vulnerability identified as CVE-2021-23336 arises from the improper handling of query parameters in Python's urllib.parse.parse_qsl and urllib.parse.parse_qs functions. When an attacker can introduce a semicolon (;) as a parameter separator, it creates a discrepancy in how the request is interpreted by the proxy server and the actual server. This can lead to malicious requests being cached as safe ones, which poses a significant risk as it can allow attackers to manipulate cached content and serve harmful responses to users.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, you can configure your proxy server to handle semicolons as valid parameter separators. However, this is not a recommended long-term solution and should only be used until the affected packages are updated.

Conclusion

CVE-2021-23336 is a significant vulnerability affecting various Python packages that can lead to web cache poisoning. It is crucial to update affected packages to their patched versions to mitigate the risks associated with this vulnerability. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for python2.7 →

Share this vulnerability

FAQ

CVE-2021-23336 is a vulnerability in Python's urllib.parse module that allows for web cache poisoning through improper handling of query parameters.

If exploited, this vulnerability can lead to malicious requests being cached as safe, potentially serving harmful content to users.

Versions of Python before 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 are vulnerable.

You can use Vulert, which monitors open-source vulnerabilities in your software. By simply using a manifest file like package-lock.json, you can check for vulnerabilities without needing to install anything.

The CVSS score for CVE-2021-23336 is 5.9, indicating a moderate level of severity.

Related vulnerabilities

Recent vulnerabilities recorded for python2.7.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback