VDB
Sign up
MEDIUM5.6

PYSEC-2026-1873

Requests `Session` object does not verify requests after making first request with verify=False

Quick fix

PYSEC-2026-1873 — requests: upgrade to the fixed version with the command below.

pip install --upgrade 'requests>=2.32.0'

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.

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.

Are you affected?

Enter the version of the package you're using.

Affected packages

PyPI/requests
Introduced in: 0Fixed in: 2.32.0
Fixpip install --upgrade 'requests>=2.32.0'

References