CVE-2026-50269: AIOHTTP Header Injection in Multipart Payloads
AIOHTTP, a popular Python framework for building asynchronous HTTP applications, contains a vulnerability in how it processes multipart request headers. If an application accepts user-controlled input and passes it directly into the header parameters of AIOHTTP's multipart functionality, an attacker can inject malicious headers or alter request contents. This affects versions prior to 3.14.0. The vulnerability requires the application developer to use user input in a specific way—passing it to MultipartWriter.append(headers=...) or Payload.headers—making it a conditional risk rather than a universal flaw in AIOHTTP itself.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Weaknesses (CWE)
- CWE-113, CWE-93
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-22 / 2026-06-26
NVD description (verbatim)
AIOHTTP is an asynchronous HTTP client/server framework for asyncio and Python. Prior to 3.14.0, attacker-controlled input included into multipart/payload headers can be used to modify a request to inject additional headers or similar. In the unlikely situation that an application is passing user-controlled strings into MultipartWriter.append(headers=...) or Payload.headers, then an attacker may be able to modify the request to inject headers or change the contents of the request. This vulnerability is fixed in 3.14.0.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability stems from improper sanitization of user-supplied strings used as headers in AIOHTTP's multipart payload handling. When attacker-controlled data reaches the headers parameter of MultipartWriter.append() or Payload.headers without validation, it can be crafted to inject additional HTTP headers or modify the structure of the multipart message. This falls under header injection (CWE-113) and improper neutralization of CRLF sequences in HTTP headers (CWE-93). The attack vector is network-based, requires no authentication, and can succeed with low complexity. The impact is primarily on availability due to request malformation, though in some scenarios header injection could affect confidentiality or integrity of subsequent request processing. The fix in version 3.14.0 includes proper header validation and sanitization to prevent injection.
Business impact
Organizations running AIOHTTP-based services that accept user input for multipart requests face potential service disruption or request manipulation. The risk is highest for applications that dynamically construct multipart messages with customer-supplied metadata, file names, or other headers. Affected systems could experience failed uploads, corrupted data transmission, or cache poisoning if intermediary systems misinterpret injected headers. However, impact is limited to applications that explicitly pass user input into AIOHTTP's header parameters—many typical uses of AIOHTTP are unaffected.
Affected systems
AIOHTTP versions prior to 3.14.0 are vulnerable. This includes all 3.13.x, 3.12.x, and earlier release lines. The vulnerability only manifests when applications use user-controlled input in the headers parameter of MultipartWriter.append() or Payload.headers. Python applications relying on AIOHTTP for HTTP communication—particularly those handling file uploads, form submissions, or dynamic content assembly—should be audited for this pattern.
Exploitability
The vulnerability has a CVSS v3.1 score of 7.5 (HIGH) due to its network accessibility, low attack complexity, and lack of authentication requirements. However, real-world exploitation depends on the target application's code logic. An attacker must identify an application that uses AIOHTTP and specifically passes unsanitized user input to the vulnerable header parameters. This is not an unauthenticated remote code execution and does not affect default configurations; it requires a specific coding pattern. The 'unlikely situation' noted in the CVE description suggests this pattern is uncommon, which may reduce the practical scope of impact.
Remediation
Upgrade AIOHTTP to version 3.14.0 or later. This is the primary and definitive mitigation. Additionally, applications should audit their codebase for any instance where user input is passed to MultipartWriter.append(headers=...) or Payload.headers; if found, implement input validation and sanitization before use. Apply whitelisting for allowed header names and values to prevent injection. For applications unable to update immediately, consider restricting multipart functionality to internal or trusted inputs only.
Patch guidance
Update AIOHTTP to 3.14.0 or the latest available version from the official PyPI repository or your organization's approved package mirrors. Standard package managers (pip, poetry, conda) should be used. Verify the update by checking the installed version with 'pip show aiohttp' and confirming it reports 3.14.0 or higher. Restart any services or applications using AIOHTTP after installation. No configuration changes are required; the fix is transparent to applications that do not use the vulnerable pattern.
Detection guidance
Search your codebase for calls to MultipartWriter.append() and Payload.headers that accept runtime or user-supplied arguments. Use static analysis tools (e.g., grep, semgrep, or IDE search) to locate these patterns. Monitor runtime logs for unusual multipart request structures or repeated header injection attempts. On systems running vulnerable AIOHTTP versions, network-based detection is difficult without deep packet inspection of multipart payloads; focus detection efforts on code review and dependency scanning. Vulnerability scanning tools that check installed package versions (e.g., pip-audit, safety) will flag AIOHTTP versions prior to 3.14.0.
Why prioritize this
This vulnerability merits prompt attention due to its HIGH CVSS score, but prioritization should account for your organization's actual AIOHTTP usage patterns. If your applications use AIOHTTP for simple HTTP requests or use static headers, the risk is lower. If you operate AIOHTTP-based services that construct multipart messages with user input (e.g., file upload services, dynamic form handlers), this should be patched within 30 days. The lack of public exploit code and the conditional nature of the vulnerability (requires specific coding pattern) suggests this is not being actively exploited at scale, but timely patching is still recommended.
Risk score, explained
CVSS 7.5 reflects a network-accessible vulnerability requiring no authentication or user interaction, with low complexity and high availability impact. The score does not discount the requirement for a specific application-level coding pattern; CVSS assumes the vulnerable code path is reachable. The actual risk to your organization depends on whether you use AIOHTTP and whether your code triggers the vulnerable pattern. Integrity and confidentiality components are not scored because the primary impact is request malformation and availability.
Frequently asked questions
Do we need to patch if we use AIOHTTP but do not build multipart requests with user input?
No. This vulnerability only affects applications that pass user-controlled data to the headers parameter of MultipartWriter.append() or Payload.headers. If your application uses AIOHTTP for standard client/server communication or uses only static headers, you are not vulnerable. Conduct a code review to confirm.
What versions of AIOHTTP are affected?
All versions prior to 3.14.0 are vulnerable. This includes all 3.13.x, 3.12.x, 3.11.x, and earlier releases. Version 3.14.0 and later include the fix.
Can this vulnerability lead to remote code execution?
No. The vulnerability is limited to header injection and request manipulation. It can cause service disruption or data corruption but does not provide a path to arbitrary code execution on the server.
Is there a workaround for applications that cannot update immediately?
Yes. Do not pass user-controlled input to the headers parameter of MultipartWriter.append() or Payload.headers. If multipart requests are necessary, sanitize and validate all user input before use, and maintain a whitelist of allowed header names and values.
This analysis is provided for informational purposes and reflects the state of information as of the publication date. SEC.co makes no warranty regarding the accuracy, completeness, or applicability of this content to your specific environment. Organizations should conduct independent testing and validation before applying patches or changes to production systems. Consult your AIOHTTP vendor advisory and security documentation for the most current guidance. Patch versions, release dates, and remediation steps may change; verify all information against official vendor sources. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-49214MEDIUMguzzlehttp/psr7 HTTP Header Injection via Untrusted URLs
- CVE-2026-55766MEDIUMguzzlehttp/psr7 CR/LF Injection in HTTP Start-Line Fields
- CVE-2026-12143HIGHform-data CRLF Injection Header Attack (Versions ≤4.0.5)
- CVE-2026-46741HIGHEtsy::StatsD Metric Injection Vulnerability (CVSS 7.5)
- CVE-2026-50292HIGHlibinput Local Privilege Escalation via Unescaped phys Output
- CVE-2026-50637HIGHMetrics::Any::Adapter::Statsd Metric Injection Vulnerability
- CVE-2026-55603HIGHhttp-proxy-middleware Multipart CR/LF Injection Vulnerability
- CVE-2026-9658HIGHPlack::Middleware::Security::Common Header Injection Bypass