GitHub Advisoryadvisory · PyPI

GHSA-9wx4-h78v-vm56 Requests `Session` object does not verify requests after making first request with verify=False

MEDIUM Published 2024-05-20 Modified 2026-01-16 Official page ↗
Aliases
CVE-2024-35195
Ecosystem
PyPI
Packages
requests
Severity
Moderate
CVSS vector
CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N
Weaknesses
CWE-670
Reviewed
2024-05-20

Affected packages

• PyPI requests: < 2.32.0 → fixed in 2.32.0

Description

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. This 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. This behavior affects versions of `requests` prior to 2.32.0.

Related

Alias · CVE (1)

Weakness · CWE (1)

  • CWE-670 Always-Incorrect Control Flow Implementation weakness

References