Python Requests Session FixationGHSA-pg2w-x9wp-vw92
Fix: kennethreitz/requests@3bd8afbGHSA-pg2w-x9wp-vw92 is a security vulnerability in requests. A fix is available for requests — see the affected versions and patch details below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
requestsReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
The resolve_redirects function in sessions.py in requests 2.1.0 through 2.5.3 allows remote attackers to conduct session fixation attacks via a cookie without a host value in a redirect.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | requests | ≥ 2.1.0&&< 2.6.0 | 2.6.0pip install --upgrade 'requests==2.6.0' |
Affected Products
ubuntu linuxcanonicalmageiamageia_projectrequestspythonDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for requests, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update requests to 2.6.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-pg2w-x9wp-vw92 is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Frequently Asked Questions
Is GHSA-pg2w-x9wp-vw92 in your dependencies?
Find it across PyPI, including transitive dependencies.