PyPI: aiohttp
CVE-2026-34518
Safety vulnerability ID: SFTY-20260401-07769
Safety legacy ID: pyup.io-91425
Affected versions of the aiohttp package are vulnerable to Information Disclosure due to improper handling of sensitive headers during cross-origin redirects. When following a redirect to a different origin, the library correctly strips the Authorization header but fails to remove the Cookie and Proxy-Authorization headers, allowing them to be forwarded to the unintended destination. An attacker controlling or observing the redirect target can capture these leaked credentials and session tokens, potentially gaining unauthorised access to user accounts or upstream proxies.
Overview
AIOHTTP leaks Cookie and Proxy-Authorization headers on cross-origin redirect
Advisory
Affected versions of the aiohttp package are vulnerable to Information Disclosure due to improper handling of sensitive headers during cross-origin redirects. When following a redirect to a different origin, the library correctly strips the Authorization header but fails to remove the Cookie and Proxy-Authorization headers, allowing them to be forwarded to the unintended destination. An attacker controlling or observing the redirect target can capture these leaked credentials and session tokens, potentially gaining unauthorised access to user accounts or upstream proxies.
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20260401-07769/CVE-2026-34518
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-34518
- https://data.safetycli.com/changelogs/aiohttp/
- https://github.com/advisories/GHSA-966j-vmvw-g2g9
- https://pypi.org/project/aiohttp
- https://github.com/aio-libs/aiohttp/security/advisories/GHSA-966j-vmvw-g2g9
- https://nvd.nist.gov/vuln/detail/CVE-2026-34518
- https://github.com/aio-libs/aiohttp/commit/5351c980dcec7ad385730efdf4e1f4338b24fdb6
- https://github.com/aio-libs/aiohttp/releases/tag/v3.13.4
- https://github.com/advisories/GHSA-966j-vmvw-g2g9
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
