# 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.

- **Severity:** Medium 5.6 (`CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N`)
- **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:** Yes
- **Published:** 20 May 2024
- **Updated:** 31 Jul 2025
- **Also known as:** ALPINE-CVE-2024-35195, ALSA-2025:0012, ALSA-2025:7049, AZL-42106, AZL-42127, AZL-42145, BELL-CVE-2024-35195, CLEANSTART-2026-ZF37263, DEBIAN-CVE-2024-35195, ECHO-8499-05d3-fb08, GHSA-9wx4-h78v-vm56, MGASA-2024-0210, MINI-6jj3-mc3h-hpvv, MINI-mrcj-w8c9-95h6, OESA-2025-2806, OESA-2025-2807, OESA-2025-2808, OESA-2025-2809, OESA-2025-2888, OESA-2025-2889, PYSEC-2026-1873, RHSA-2024:9988, RHSA-2025:0012, RHSA-2025:7049, RLSA-2025:0012, RLSA-2025:7049, ROOT-APP-PYPI-CVE-2024-35195, ROOT-OS-UBUNTU-2204-CVE-2024-35195, SUSE-RU-2024:3598-1, SUSE-RU-2024:3599-1, SUSE-RU-2024:3600-1, SUSE-SU-2024:1857-1, SUSE-SU-2024:1880-1, SUSE-SU-2024:1880-2, SUSE-SU-2024:1937-1, SUSE-SU-2024:1937-2, SUSE-SU-2024:1938-1, SUSE-SU-2024:1946-1, SUSE-SU-2024:2068-1, SUSE-SU-2024:2182-1, SUSE-SU-2025:20034-1, SUSE-SU-2025:20094-1, UBUNTU-CVE-2024-35195

## 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 (Always-Incorrect Control Flow Implementation)

## Which versions are affected by CVE-2024-35195?

3 open source packages ship an affected version, including requests.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `requests` | PyPI | All versions | 2.32.0 |
| `requests` | PyPI | All versions | 2.32.0 |
| `requests` | PyPI | All versions | 2.32.0 |
| `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.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-35195 and fix it if it is affected.

What it is: 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.
Exploitation: There is no known exploitation of CVE-2024-35195 in the wild and no public exploit code.

Affected packages and fixed versions:
- requests (PyPI): affected all versions; fixed in 2.32.0
- requests (PyPI): affected all versions; fixed in 2.32.0
- requests (PyPI): affected all versions; fixed in 2.32.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-35195/ (Markdown: https://insights.sbomify.com/CVE-2024-35195/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-35195
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-35195
- OSV: https://osv.dev/vulnerability/CVE-2024-35195

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-35195/
Summaries are generated and may contain mistakes; the official description above is the record.
