CVE-2021-21330: `aiohttp` Open Redirect vulnerability (`normalize_path_middleware` middleware)
3.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.67123%
CWE
Published
2/26/2021
Updated
9/3/2024
KEV Status
No
Technology
Python
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
aiohttp | pip | < 3.7.4 | 3.7.4 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability was explicitly tied to the normalize_path_middleware middleware. The GitHub commit diff shows the security fix added a regex substitution (re.sub('^//+', '/', path)) in the middleware's implementation function to limit leading slashes. This code modification directly addresses the open redirect vector by ensuring the Location header's path starts with exactly one slash. The vulnerability manifests in the path processing loop where unvalidated paths could lead to unsafe redirects.