Requests `Session` object does not verify requests after making first request with verify=False
Description
Published to the GitHub Advisory Database
May 20, 2024
Reviewed
May 20, 2024
Published by the National Vulnerability Database
May 20, 2024
Last updated
Jan 16, 2026
When using a
requests.Session, if the first request to a given origin is made withverify=False, TLS certificate verification may remain disabled for all subsequent requests to that origin, even ifverify=Trueis 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
requestsprior to 2.32.0.References