Open Redirect Vulnerability in Python Aiohttp Package

python-aiohttp Updated 02 Oct 2025

Summary

26/02/2021
N/A
Yes i
Low
3.1

UBUNTU-CVE-2021-21330: aiohttp is an asynchronous HTTP client/server framework for asyncio and Python. Affects python-aiohttp versions < 3.0.1-1ubuntu0.1~esm1. Fixed in 3.0.1-1ubuntu0.1~esm1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Aiohttp is an asynchronous HTTP client/server framework designed for asyncio and Python. It allows developers to build web applications with non-blocking capabilities, making it efficient for handling multiple requests simultaneously. However, prior to version 3.7.4, Aiohttp was found to have a critical vulnerability that could lead to open redirects, potentially compromising user security.

Vulnerability Detail

The vulnerability in Aiohttp arises from a flaw in the aiohttp.web_middlewares.normalize_path_middleware middleware, which allows a malicious actor to craft a link that redirects users to an unintended website. This could lead to phishing attacks or other malicious activities, as users may be misled into providing sensitive information on a fraudulent site. The issue has been identified as CVE-2021-21330 and has a CVSS score of 3.1, indicating a medium severity level.

How To Fix

Minimum fixed version

3.0.1-1ubuntu0.1~esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-aiohttp

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading the package is not feasible, a temporary workaround is to avoid using the aiohttp.web_middlewares.normalize_path_middleware in your applications. This can help prevent the exploitation of the vulnerability until a proper update can be applied.

Conclusion

The open redirect vulnerability in the Aiohttp package poses a significant risk to applications using this framework. It is crucial for developers to upgrade to the patched version to ensure user safety and prevent potential exploitation. Utilizing tools like Vulert can further enhance security monitoring.

See every vulnerability recorded for python-aiohttp →

Share this vulnerability

FAQ

The vulnerability is an open redirect issue that allows attackers to redirect users to malicious websites.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If exploited, this vulnerability could lead to phishing attacks, where users are redirected to fraudulent sites that mimic legitimate ones.

Yes, the vulnerability has been fixed in Aiohttp version 3.7.4 and later. It is recommended to upgrade to this version or higher.

Vulert monitors and alerts for open-source vulnerabilities in software using a manifest file like package-lock.json, providing real-time insights without requiring code access.

Related vulnerabilities

Recent vulnerabilities recorded for python-aiohttp.

How To Fix

Minimum fixed version

3.0.1-1ubuntu0.1~esm1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-aiohttp

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback