Requests Library Insecure Temporary File Handling Vulnerability in CA Bundle Extraction

Vulnerability

A vulnerability exists in the Requests library prior to version 2.33.0, specifically in the `requests.utils.extract_zipped_paths()` function. This function, used by `HTTPAdapter.cert_verify()` to load the CA bundle, often from the `certifi` package's zipapp structure, extracts files from zip archives to the system's temporary directory using a predictable filename. If the file already exists, it is reused without proper validation, creating an opportunity for local attackers to pre-insert a malicious CA bundle file that could be loaded by an application with potentially higher privileges.

Impact

Exploitation allows for the replacement of a legitimate CA bundle file with a malicious one, which could be used to undermine certificate verification processes in applications that rely on the Requests library.

Remediation

Users are advised to upgrade to Requests version 2.33.0 or later, where this vulnerability has been addressed. If an upgrade is not possible, set the `TMPDIR` environment variable to a directory with restricted write access.

Added: Mar 25, 2026, 7:56 PM
Updated: Mar 25, 2026, 7:56 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
3.1
exploitability
3.7
remediation
0.0
relevance
4.7
threat
3.2
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.