Headline
GHSA-9wx4-h78v-vm56: Requests `Session` object does not verify requests after making first request with verify=False
When making requests through a Requests Session
, if the first request is made with verify=False
to disable cert verification, all subsequent requests to the same origin will continue to ignore cert verification regardless of changes to the value of verify
. This behavior will continue for the lifecycle of the connection in the connection pool.
Remediation
Any of these options can be used to remediate the current issue, we highly recommend upgrading as the preferred mitigation.
- Upgrade to
requests>=2.32.0
. - For
requests<2.32.0
, avoid settingverify=False
for the first request to a host while using a Requests Session. - For
requests<2.32.0
, callclose()
onSession
objects to clear existing connections ifverify=False
is used.
Related Links
- https://github.com/psf/requests/pull/6655
When making requests through a Requests Session, if the first request is made with verify=False to disable cert verification, all subsequent requests to the same origin will continue to ignore cert verification regardless of changes to the value of verify. This behavior will continue for the lifecycle of the connection in the connection pool.
Remediation
Any of these options can be used to remediate the current issue, we highly recommend upgrading as the preferred mitigation.
- Upgrade to requests>=2.32.0.
- For requests<2.32.0, avoid setting verify=False for the first request to a host while using a Requests Session.
- For requests<2.32.0, call close() on Session objects to clear existing connections if verify=False is used.
Related Links
- psf/requests#6655
References
- GHSA-9wx4-h78v-vm56
- psf/requests#6655
- psf/requests@a58d7f2
Related news
Red Hat Security Advisory 2024-4522-03 - An update is now available for Red Hat Ansible Automation Platform 2.4. Issues addressed include a denial of service vulnerability.
Red Hat Security Advisory 2024-3781-03 - An update is now available for Red Hat Ansible Automation Platform 2.4. Issues addressed include HTTP request smuggling, buffer overflow, code execution, cross site scripting, denial of service, memory exhaustion, null pointer, and password leak vulnerabilities.