CVE-2024-35195 Requests `Session` object does not verify requests after making first request with verify=False

Medium 5.6 Published Updated

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.

PackageAffectedFixed in
requests PyPIAll versions2.32.0
requests PyPIAll versions2.32.0
requests PyPIAll versions2.32.0
Linux distribution packages (37)
python3-requests AlmaLinux:8All versions2.20.0-5.el8_10
python3-requests AlmaLinux:9All versions2.25.1-9.el9
python3-requests+security AlmaLinux:9All versions2.25.1-9.el9
python3-requests+socks AlmaLinux:9All versions2.25.1-9.el9
python-requests Red Hat:enterprise_linux:8::baseosAll versions0:2.20.0-5.el8_10
python3-requests Red Hat:enterprise_linux:8::baseosAll versions0:2.20.0-5.el8_10
python3-requests+security Red Hat:enterprise_linux:9::appstreamAll versions0:2.25.1-9.el9
python3-requests+socks Red Hat:enterprise_linux:9::appstreamAll versions0:2.25.1-9.el9
python-requests Red Hat:enterprise_linux:9::baseosAll versions0:2.25.1-9.el9
python3-requests Red Hat:enterprise_linux:9::baseosAll versions0:2.25.1-9.el9
python-requests Red Hat:openstack:17.1::el8All versions0:2.25.1-2.el8ost
python3-requests Red Hat:openstack:17.1::el8All versions0:2.25.1-2.el8ost
python-requests Rocky Linux:8All versions0:2.20.0-5.el8_10
python-requests Rocky Linux:9All versions0:2.25.1-9.el9
python-requests SUSE:Enterprise Storage 7.1All versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise High Availability Extension 12 SP5All versions2.24.0-8.17.1
python-requests SUSE:Linux Enterprise High Availability Extension 12 SP5All versions2.24.0-8.20.1
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSSAll versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions2.31.0-150400.6.15.1
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions2.31.0-150400.6.15.1
python-requests SUSE:Linux Enterprise Micro 5.1All versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise Micro 5.2All versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise Micro 5.3All versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise Micro 5.4All versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise Micro 5.5All versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise Module for Advanced Systems Management 12All versions2.11.1-6.37.1
python-requests SUSE:Linux Enterprise Module for Advanced Systems Management 12All versions2.11.1-6.40.1
python-requests SUSE:Linux Enterprise Module for Basesystem 15 SP5All versions2.25.1-150300.3.9.1
python-requests SUSE:Linux Enterprise Module for Basesystem 15 SP6All versions2.25.1-150300.3.9.1
python-docker SUSE:Linux Enterprise Module for Package Hub 15 SP5All versions4.2.0-150200.3.5.1
python-docker SUSE:Linux Enterprise Module for Package Hub 15 SP6All versions4.2.0-150200.3.5.1
python-requests SUSE:Linux Enterprise Module for Public Cloud 12All versions2.24.0-8.17.1
python-requests SUSE:Linux Enterprise Module for Public Cloud 12All versions2.24.0-8.20.1
python-docker SUSE:Linux Enterprise Module for Public Cloud 15 SP4All versions7.0.0-150400.8.7.1
python-requests SUSE:Linux Enterprise Module for Public Cloud 15 SP4All versions2.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.

Is CVE-2024-35195 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free