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.
{
"github_reviewed": true,
"github_reviewed_at": "2024-05-20T20:15:00Z",
"severity": "MODERATE",
"nvd_published_at": "2024-05-20T21:15:09Z",
"cwe_ids": [
"CWE-670"
]
}