Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
🐍
🐍 PyPI
Not in CISA KEV
MEDIUM severity

CVE-2021-21330 — aiohttp

MEDIUMFix: aio-libs/aiohttp@2545222

CVE-2021-21330 is a medium-severity (CVSS 6.1) Open Redirect vulnerability in aiohttp. A fix is available for aiohttp — see the affected versions and patch details below.

`aiohttp` Open Redirect vulnerability (`normalize_path_middleware` middleware)

Also known asGHSA-v6wp-4m6f-gcjgPYSEC-2021-76
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Oct 9, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
1.9%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs79th percentile — riskier than 79% of all scored CVEsHighest risk
0.00%0.80%1.60%2.41%0.5%1.9%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2021-21330 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,987 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

1 pkg affected
🐍aiohttp

Real-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

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.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
🐍PyPIaiohttpall versions3.7.4pip install --upgrade 'aiohttp==3.7.4'

Affected Products

3 products · 4 configurations
Application
aiohttpaiohttp
< 3.7.4
range
OS
debian linuxdebian
1 version
10.0
OS
fedorafedoraproject
2 versions
3334

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for aiohttp, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update aiohttp to 3.7.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-21330 is resolved across your whole dependency graph.

  3. Workarounds

    Stop reflecting attacker-controlled destinations: resolve every redirect target against an allowlist of paths or hosts you own, prefer a server-side key over a full URL in the request, and reject absolute URLs entirely where the flow only ever needs a relative one.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatModerate

Red Hat Satellite version 6.7 onward (mostly pulp part) does ship an affected version of aiohttp, however, is not vulnerable since the product code does not use the normalize_path_middleware function, which the attacker may use for an attack. We may update the python-aiohttp dependency in a future release.

ProductFixed inAdvisory
Red Hat Satellite 6.10 for RHEL 7python-aiohttp-0:3.7.4-1.el7pcRHSA-2021:4702

Frequently Asked Questions

### 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 * [aiohttp @ PyPI] * [GHSA-v6wp-4m6f-gcjg
O3 Security · Impact-Aware SCA

Is CVE-2021-21330 in your dependencies?

Find it across PyPI, including transitive dependencies.

CVE-2021-21330: aiohttp Open Redirect — Fixed in 3.7.4