CVE-2026-1502
HTTP Header Injection via CR/LF in Python HTTP Client Proxy
Publication date: 2026-04-10
Last updated on: 2026-04-21
Assigner: Python Software Foundation
Description
Description
CVSS Scores
EPSS Scores
| Probability: | |
| Percentile: |
Meta Information
Affected Vendors & Products
| Vendor | Product | Version / Range |
|---|---|---|
| python | cpython | 3.10 |
| python | cpython | 3.11 |
| python | cpython | 3.12 |
| python | cpython | 3.13 |
| python | cpython | 3.14 |
| python | cpython | 3.15 |
Helpful Resources
Exploitability
| CWE ID | Description |
|---|---|
| CWE-UNKNOWN |
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?
CVE-2026-1502 is a security vulnerability in Python's HTTP client proxy tunneling implementation. The issue arises because the HTTP client did not properly reject carriage return (CR) and line feed (LF) characters in proxy tunnel request headers and the tunnel host field.
This flaw allows an attacker to inject malicious HTTP headers or manipulate HTTP requests by exploiting the presence of CR/LF characters, which can lead to HTTP header injection or request smuggling attacks.
The vulnerability was fixed by adding strict validation to reject any CR or LF characters in both the header names and values, as well as in the tunnel host string, ensuring that malformed or malicious headers cannot be introduced during HTTP CONNECT proxy tunneling.
How can this vulnerability impact me? :
This vulnerability can impact you by allowing attackers to perform HTTP header injection or request smuggling attacks through the HTTP proxy tunnel.
Such attacks can manipulate or inject malicious headers into HTTP requests, potentially compromising the security and integrity of HTTP proxy connections.
This could lead to unauthorized access, data leakage, or bypassing security controls that rely on proper HTTP header handling.
How can this vulnerability be detected on my network or system? Can you suggest some commands?
This vulnerability involves the acceptance of carriage return (CR) and line feed (LF) characters in HTTP proxy tunnel headers, which can lead to header injection or request smuggling attacks.
To detect this vulnerability on your network or system, you can monitor HTTP CONNECT proxy tunnel requests for suspicious or malformed headers containing CR or LF characters.
Commands or methods to detect this might include capturing and inspecting HTTP proxy traffic using tools like tcpdump or Wireshark, filtering for CONNECT requests, and checking for CR/LF injection attempts.
- Use tcpdump to capture HTTP proxy traffic: tcpdump -i <interface> -A 'tcp port 8080 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)'
- Use Wireshark to filter HTTP CONNECT requests and inspect headers for CR (\r) or LF (\n) characters that are not properly sanitized.
- Implement logging or debugging in Python HTTP client code to detect if .set_tunnel() method inputs contain CR or LF characters, which should raise ValueError after the patch.
What immediate steps should I take to mitigate this vulnerability?
To mitigate CVE-2026-1502, you should update your Python environment to a version that includes the fix for this vulnerability.
The fix rejects any carriage return (CR) or line feed (LF) characters in HTTP tunnel request headers and hostnames, preventing header injection and request smuggling attacks.
- Upgrade to a Python version where the fix has been backported, such as versions 3.10 through 3.14 or later, as the patch has been merged and backported to these releases.
- Ensure that any HTTP client code using the .set_tunnel() method properly sanitizes inputs and handles exceptions raised due to invalid headers.
- If upgrading immediately is not possible, consider implementing network-level filtering to block HTTP CONNECT requests containing suspicious CR/LF sequences.
How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:
The provided information does not specify any direct impact of CVE-2026-1502 on compliance with common standards and regulations such as GDPR or HIPAA.