CVE-2021-21330
JSON

3.1low

Open redirect vulnerability in aiohttp

Severity
3.1low CVSS:3.1 by GitHub_M
Exploit likelihood
1.72% (higher than 78% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-v6wp-4m6f-gcjgPYSEC-2021-76

Description

aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. In aiohttp before version 3.7.4 there is an open redirect vulnerability. A maliciously crafted link to an aiohttp-based web-server could redirect the browser to a different website. It is caused by a bug in the `aiohttp.web_middlewares.normalize_path_middleware` middleware. This security problem has been fixed in 3.7.4. Upgrade your dependency using pip as follows "pip install aiohttp >= 3.7.4". If upgrading is not an option for you, a workaround can be to avoid using `aiohttp.web_middlewares.normalize_path_middleware` in your applications.

Affected

Product or packageVersionsReported by
aio-libs aiohttp< 3.7.4CVE List
aiohttp (PyPI)before 3.7.4, before 2545222a3853e31ace15d87ae0e2effb7da0c96bGitHub Advisory Database, PyPA Advisory Database
aiohttp aiohttpbefore 3.7.4NVD
debian debian_linux10.0NVD
fedoraproject fedora33, 34NVD

All scores

GitHub_M3.1low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N
GitHub3.1low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:N
GitHublow CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
NVD5.8medium CVSS:2.0AV:N/AC:M/Au:N/C:P/I:P/A:N

Classification

What each source says

CVE List

aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. In aiohttp before version 3.7.4 there is an open redirect vulnerability. A maliciously crafted link to an aiohttp-based web-server could redirect the browser to a different website. It is caused by a bug in the `aiohttp.web_middlewares.normalize_path_middleware` middleware. This security problem has been fixed in 3.7.4. Upgrade your dependency using pip as follows "pip install aiohttp >= 3.7.4". If upgrading is not an option for you, a workaround can be to avoid using `aiohttp.web_middlewares.normalize_path_middleware` in your applications.

GitHub Advisory Database
Impact

Open redirect vulnerability — a maliciously crafted link to an aiohttp-based web-server could redirect the browser to a different website.

It is caused by a bug in the aiohttp.web_middlewares.normalize_path_middleware middleware.

Patches

This security problem has been fixed in v3.7.4. Upgrade your dependency as follows: pip install aiohttp >= 3.7.4

Workarounds

If upgrading is not an option for you, a workaround can be to avoid using aiohttp.web_middlewares.normalize_path_middleware in your applications.

References
For more information

If you have any questions or comments about this advisory:

Credit: Jelmer Vernooij and Beast Glatisant.

NVD (es)

aiohttp es un framework cliente/servidor HTTP asincrónico para asyncio y Python.&#xa0;En aiohttp versiones anteriores a 3.7.4, se presenta una vulnerabilidad de redireccionamiento abierto.&#xa0;Un enlace diseñado malicioso en un servidor web basado en aiohttp podría redireccionar el navegador a un sitio web diferente.&#xa0;Es causado por un error en el middleware "aiohttp.web_middlewares.normalize_path_middleware".&#xa0;Este problema de seguridad ha sido corregido en versión 3.7.4.&#xa0;Actualice su dependencia usando pip de la siguiente manera "pip install aiohttp versiones posteriores o incluyendo a 3.7.4".&#xa0;Si la actualización no es una opción para usted, una solución alternativa puede ser evitar el uso de "aiohttp.web_middlewares.normalize_path_middleware" en sus aplicaciones

References

https://github.com/aio-libs/aiohttp/security/advisories/GHSA-v6wp-4m6f-gcjgadvisory, third-party-advisory, web
https://github.com/aio-libs/aiohttp/commit/2545222a3853e31ace15d87ae0e2effb7da0c96bfix, patch, third-party-advisory, web
https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst#374-2021-02-25third-party-advisory, web
https://pypi.org/project/aiohttp/package, product, third-party-advisory
https://www.debian.org/security/2021/dsa-4864advisory, third-party-advisory, vendor-advisory, web
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JN3V7CZJRT4QFCVXB6LDPCJH7NAOFCA5/vendor-advisory
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FU7ENI54JNEK3PHEFGCE46DGMFNTVU6L/vendor-advisory
https://security.gentoo.org/glsa/202208-19third-party-advisory, vendor-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2021-21330advisory
https://github.com/aio-libs/aiohttppackage
https://github.com/pypa/advisory-database/tree/main/vulns/aiohttp/PYSEC-2021-76.yamlweb
https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FU7ENI54JNEK3PHEFGCE46DGMFNTVU6Lweb

Sources

SourceRecordLicence
CVE ListCVE-2021-21330 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-v6wp-4m6f-gcjg changed 2026-07-08CC-BY-4.0
NVDCVE-2021-21330 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2021-76 changed 2023-11-08CC-BY-4.0