CVE-2026-54276
Executive Summary
CVE-2026-54276 is a security vulnerability in the AIOHTTP library, an asynchronous HTTP client/server framework for Python. The flaw resides in the DigestAuthMiddleware component, which can inadvertently send an authentication response after following a cross-origin redirect. This behavior could allow an attacker, who has already achieved an open redirect or similar on the target domain, to capture a user's digest authentication credentials. The vulnerability is rated with a CVSS score of 0.0 due to the high complexity and prerequisites required for exploitation, but it poses a real risk in scenarios where weak cryptography or password reuse is present. The issue is fixed in AIOHTTP version 3.14.1.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the AIOHTTP Python package, which is widely used in web applications and microservices. Organizations using AIOHTTP should immediately update to version 3.14.1 or later to mitigate the risk. The package is distributed via PyPI, and the fix is available in the official repository. No known public exploits or proof-of-concept code have been released at this time.
CVSS Breakdown & Threat Level
- Attack Vector (AV): Network (N) – The attack is carried out over the network.
- Attack Complexity (AC): High (H) – Exploitation requires an open redirect or similar vulnerability on the target domain.
- Privileges Required (PR): None (N) – No authentication is needed to initiate the attack.
- User Interaction (UI): Required (R) – The victim must interact with a malicious link or page.
- Scope (S): Unchanged (U) – The vulnerability does not affect other components.
- Confidentiality (C): Low (L) – Only digest credentials are potentially exposed, which are hashed.
- Integrity (I): None (N) – No data integrity impact.
- Availability (A): None (N) – No availability impact.
Threat Level: Low to Medium. The high attack complexity and required user interaction reduce the immediate threat, but the potential for credential theft in weak cryptographic scenarios warrants attention.
Deep Dive & Mechanics
The vulnerability arises from the DigestAuthMiddleware in AIOHTTP, which is designed to handle HTTP Digest Authentication. When a client sends a request to a protected resource, the middleware generates a digest authentication response. However, if the server responds with a redirect to a different origin (cross-origin), the middleware incorrectly follows that redirect and sends the authentication response to the new origin. This behavior violates the principle of not sending credentials across origins without explicit user consent.
The attack scenario requires:
- An attacker-controlled or compromised domain that can issue a redirect to a different origin.
- The victim must be authenticated to the attacker's domain (or the attacker must have an open redirect on a trusted domain).
- The victim's browser or client must be configured to use Digest Authentication.
When the victim accesses a resource on the attacker's domain, the middleware sends the digest response. If the attacker can capture this response, they may attempt to crack the hash or reuse the credentials if the victim uses the same password elsewhere.
Vulnerable vs. Patched Code
Vulnerable Code (prior to 3.14.1):
# In DigestAuthMiddleware, the middleware follows redirects without checking origin
async def _handle_request(self, request):
response = await self._send_request(request)
if response.status in (301, 302, 303, 307, 308):
# Follow redirect without origin check
return await self._handle_request(request.clone(url=response.headers['Location']))
return response
Patched Code (3.14.1):
# The fix adds an origin check before following redirects
async def _handle_request(self, request):
response = await self._send_request(request)
if response.status in (301, 302, 303, 307, 308):
new_url = response.headers['Location']
if not self._is_same_origin(request.url, new_url):
# Do not follow cross-origin redirects
return response
return await self._handle_request(request.clone(url=new_url))
return response
def _is_same_origin(self, url1, url2):
# Compare scheme, host, and port
return (url1.scheme == url2.scheme and
url1.host == url2.host and
url1.port == url2.port)
Exploitation & Lab Setup
Red Team
To simulate this vulnerability, set up a controlled environment with:
- A vulnerable AIOHTTP server (version < 3.14.1) configured with Digest Authentication.
- An attacker-controlled server that issues a redirect to a different origin.
- A client (e.g., a Python script using AIOHTTP) that accesses the attacker's server.
Step-by-step:
- Install a vulnerable version of AIOHTTP:
pip install aiohttp==3.14.0 - Create a simple server with DigestAuthMiddleware:
from aiohttp import web
from aiohttp.web_middlewares import DigestAuthMiddleware
async def protected(request):
return web.Response(text="Protected resource")
app = web.Application()
app.middlewares.append(DigestAuthMiddleware())
app.router.add_get('/protected', protected)
web.run_app(app, port=8080)
- Set up an attacker server that redirects to a different origin:
from aiohttp import web
async def redirect(request):
raise web.HTTPFound('/redirected')
app = web.Application()
app.router.add_get('/redirect', redirect)
web.run_app(app, port=9090)
- Run a client that accesses the attacker server:
import asyncio
from aiohttp import ClientSession
async def main():
async with ClientSession() as session:
async with session.get('http://attacker:9090/redirect') as resp:
print(await resp.text())
asyncio.run(main())
- Observe that the middleware sends the digest response to the redirected origin.
Blue Team
To detect exploitation attempts:
- Monitor for unusual cross-origin redirects in HTTP traffic.
- Look for Digest Authentication headers being sent to unexpected origins.
- Use network monitoring tools to capture and analyze authentication flows.
Indicators of Compromise (IOCs)
- Network: HTTP requests with Digest Authentication headers (
Authorization: Digest ...) followed by a redirect to a different origin. - Logs: Server logs showing authentication attempts from unexpected referrers or origins.
- File: Presence of AIOHTTP version < 3.14.1 in Python environments.
Detection Engineering
YARA Rule
rule CVE_2026_54276_AIOHTTP_DigestAuth
{
meta:
description = "Detects vulnerable AIOHTTP DigestAuthMiddleware code"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2026-54276"
strings:
$vuln_code = "DigestAuthMiddleware" nocase
$redirect_follow = "response.status in (301, 302, 303, 307, 308)" nocase
$no_origin_check = "request.clone(url=response.headers['Location'])" nocase
condition:
all of them
}
Sigma Rule
title: CVE-2026-54276 - AIOHTTP DigestAuthMiddleware Cross-Origin Redirect
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects potential exploitation of CVE-2026-54276 by monitoring for Digest Authentication headers sent after cross-origin redirects.
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: aiohttp
detection:
selection:
http.response.status: [301, 302, 303, 307, 308]
http.request.headers.authorization: "Digest*"
condition: selection
falsepositives:
- Legitimate cross-origin redirects with Digest Authentication (rare)
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2026-54276 - AIOHTTP DigestAuthMiddleware Cross-Origin Redirect"; flow:to_server; content:"Authorization|3a| Digest"; http_header; content:"Location|3a|"; http_header; pcre:"/^Location:\s*https?:\/\/(?!\Q$HOST\E)/mi"; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Upgrade AIOHTTP to version 3.14.1 or later.
- Workaround: If upgrading is not possible, disable Digest Authentication or implement custom middleware that validates redirect origins.
- Long-term: Review all middleware that handles authentication to ensure they do not follow cross-origin redirects.
- Monitoring: Implement detection rules as provided above to identify potential exploitation attempts.
Valters IT
Securing digital frontiers, one CVE at a time.