CVE-2024-35195 Requests `Session` object does not verify requests after making first request with verify=False
Attackers can bypass TLS certificate verification in Python Requests sessions if the first request disables verification, allowing man-in-the-middle attacks.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2024-35195?
CVE-2024-35195 is a medium-severity vulnerability in psf requests, published on 20 May 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
Requests is a HTTP library. Prior to 2.32.0, when making requests through a Requests `Session`, if the first request is made with `verify=False` to disable cert verification, all subsequent requests to the same host will continue to ignore cert verification regardless of changes to the value of `verify`. This behavior will continue for the lifecycle of the connection in the connection pool. This vulnerability is fixed in 2.32.0.
Weakness: CWE-670
Which versions are affected by CVE-2024-35195?
3 open source packages ship an affected version, including requests.
| Package | Affected | Fixed in |
|---|---|---|
requests PyPI | All versions | 2.32.0 |
requests PyPI | All versions | 2.32.0 |
requests PyPI | All versions | 2.32.0 |
Linux distribution packages (37)
python3-requests AlmaLinux:8 | All versions | 2.20.0-5.el8_10 |
python3-requests AlmaLinux:9 | All versions | 2.25.1-9.el9 |
python3-requests+security AlmaLinux:9 | All versions | 2.25.1-9.el9 |
python3-requests+socks AlmaLinux:9 | All versions | 2.25.1-9.el9 |
python-requests Red Hat:enterprise_linux:8::baseos | All versions | 0:2.20.0-5.el8_10 |
python3-requests Red Hat:enterprise_linux:8::baseos | All versions | 0:2.20.0-5.el8_10 |
python3-requests+security Red Hat:enterprise_linux:9::appstream | All versions | 0:2.25.1-9.el9 |
python3-requests+socks Red Hat:enterprise_linux:9::appstream | All versions | 0:2.25.1-9.el9 |
python-requests Red Hat:enterprise_linux:9::baseos | All versions | 0:2.25.1-9.el9 |
python3-requests Red Hat:enterprise_linux:9::baseos | All versions | 0:2.25.1-9.el9 |
python-requests Red Hat:openstack:17.1::el8 | All versions | 0:2.25.1-2.el8ost |
python3-requests Red Hat:openstack:17.1::el8 | All versions | 0:2.25.1-2.el8ost |
python-requests Rocky Linux:8 | All versions | 0:2.20.0-5.el8_10 |
python-requests Rocky Linux:9 | All versions | 0:2.25.1-9.el9 |
python-requests SUSE:Enterprise Storage 7.1 | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise High Availability Extension 12 SP5 | All versions | 2.24.0-8.17.1 |
python-requests SUSE:Linux Enterprise High Availability Extension 12 SP5 | All versions | 2.24.0-8.20.1 |
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | All versions | 2.31.0-150400.6.15.1 |
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | All versions | 2.31.0-150400.6.15.1 |
python-requests SUSE:Linux Enterprise Micro 5.1 | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise Micro 5.2 | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise Micro 5.3 | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise Micro 5.4 | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise Micro 5.5 | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise Module for Advanced Systems Management 12 | All versions | 2.11.1-6.37.1 |
python-requests SUSE:Linux Enterprise Module for Advanced Systems Management 12 | All versions | 2.11.1-6.40.1 |
python-requests SUSE:Linux Enterprise Module for Basesystem 15 SP5 | All versions | 2.25.1-150300.3.9.1 |
python-requests SUSE:Linux Enterprise Module for Basesystem 15 SP6 | All versions | 2.25.1-150300.3.9.1 |
python-docker SUSE:Linux Enterprise Module for Package Hub 15 SP5 | All versions | 4.2.0-150200.3.5.1 |
python-docker SUSE:Linux Enterprise Module for Package Hub 15 SP6 | All versions | 4.2.0-150200.3.5.1 |
python-requests SUSE:Linux Enterprise Module for Public Cloud 12 | All versions | 2.24.0-8.17.1 |
python-requests SUSE:Linux Enterprise Module for Public Cloud 12 | All versions | 2.24.0-8.20.1 |
python-docker SUSE:Linux Enterprise Module for Public Cloud 15 SP4 | All versions | 7.0.0-150400.8.7.1 |
python-requests SUSE:Linux Enterprise Module for Public Cloud 15 SP4 | All versions | 2.31.0-150400.6.12.1 |
How do I fix CVE-2024-35195?
Upgrade requests to 2.32.0 or later.
Is CVE-2024-35195 being exploited?
There is no known exploitation of CVE-2024-35195 in the wild and no public exploit code.
Sources
Also known as ALPINE-CVE-2024-35195, ALSA-2025:0012, ALSA-2025:7049, AZL-42106, AZL-42127, AZL-42145 and 37 more.