CVE-2024-35195: Requests Requests `Session` Object Does Not Vulnerability
MODERATECVE-2024-35195 is a MODERATE (CVSS 5.6) requests `session` object does not vulnerability (CWE-670: Always-Incorrect Control Flow Implementation) affecting Requests libraries in the PyPI ecosystem. The issue involves requests `session` object does not verify requests after making first request with verify=false. Remediation is available by upgrading affected packages to version 2.32.0.
CVE-2024-35195 at a Glance
Security Impact
CVSS: 5.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N).
How to Fix CVE-2024-35195
To remediate this vulnerability, upgrade all affected Requests dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install requests>=2.32.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show requests
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-35195, inspect your installed packages using pip:
pip show requests
Analyze the terminal output to locate any version of Requests in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.32.0), your application is affected.
Note: The pip show requests command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-670: Always-Incorrect Control Flow Implementation, where the code contains a control flow path that does not reflect the algorithm that the path is intended to implement, leading to incorrect behavior any time this path is navigated. In Requests, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-35195 Affected Requests Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
requests
|
PyPI |
< 2.32.0
|
2.32.0
|
References
Frequently Asked Questions
What is CVE-2024-35195?
Which Requests versions are affected?
What version fixes CVE-2024-35195?
Is requests affected?
What is the CVSS score of CVE-2024-35195?
What CWE is associated with CVE-2024-35195?
How can I check PyPI dependencies for CVE-2024-35195?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-9wx4-h78v-vm56",
"modified" : "2026-01-16T00:02:49Z",
"published" : "2024-05-20T20:15:00Z",
"aliases" : [ "CVE-2024-35195" ],
"summary" : "Requests `Session` object does not verify requests after making first request with verify=False",
"details" : "When using a `requests.Session`, if the first request to a given origin is made with `verify=False`, TLS certificate verification may remain disabled for all subsequent requests to that origin, even if `verify=True` is explicitly specified later.\n\nThis occurs because the underlying connection is reused from the session's connection pool, causing the initial TLS verification setting to persist for the lifetime of the pooled connection. As a result, applications may unintentionally send requests without certificate verification, leading to potential man-in-the-middle attacks and compromised confidentiality or integrity.\n\nThis behavior affects versions of `requests` prior to 2.32.0.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "requests"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.32.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/psf/requests/security/advisories/GHSA-9wx4-h78v-vm56"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-35195"
}, {
"type" : "WEB",
"url" : "https://github.com/psf/requests/pull/6655"
}, {
"type" : "WEB",
"url" : "https://github.com/psf/requests/commit/a58d7f2ffb4d00b46dca2d70a3932a0b37e22fac"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/psf/requests"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IYLSNK5TL46Q6XPRVMHVWS63MVJQOK4Q"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/N7WP6EYDSUOCOJYHDK5NX43PYZ4SNHGZ"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-670" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-05-20T20:15:00Z",
"nvd_published_at" : "2024-05-20T21:15:09Z"
}
}