Advisory

GHSA-9wx4-h78v-vm56

Also known as: CVE-2024-35195, PYSEC-2026-1873

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.

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.

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2024-05-20 20:15 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

requests

PyPI · All systems

Affected

  • introduced 0, fixed 2.32.0 (ecosystem)

Fixed versions

2.32.0

Fix

  • Fixed version 2.32.0
    pip install --upgrade requests==2.32.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences