CVE-2022-24766: Mitmproxy Insufficient Protection Against HTTP Request Vulnerability
CRITICALCVE-2022-24766 is a CRITICAL (CVSS 9.8) insufficient protection against http request vulnerability (CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')) affecting Mitmproxy libraries in the PyPI ecosystem. The issue involves insufficient protection against http request smuggling in mitmproxy. Remediation is available by upgrading affected packages to version 8.0.0.
CVE-2022-24766 at a Glance
Security Impact
CVSS: 9.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-24766
To remediate this vulnerability, upgrade all affected Mitmproxy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install mitmproxy>=8.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show mitmproxy
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-24766, inspect your installed packages using pip:
pip show mitmproxy
Analyze the terminal output to locate any version of Mitmproxy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.0.0), your application is affected.
Note: The pip show mitmproxy command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling'), where the product acts as an intermediary http agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed http requests or responses in ways that are consistent with how the messages will be processed by those entities that are at the ultimate destination. In Mitmproxy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-24766 Affected Mitmproxy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mitmproxy
|
PyPI |
< 8.0.0
|
8.0.0
|
References
Frequently Asked Questions
What is CVE-2022-24766?
Which Mitmproxy versions are affected?
What version fixes CVE-2022-24766?
Is mitmproxy affected?
What is the CVSS score of CVE-2022-24766?
What CWE is associated with CVE-2022-24766?
How can I check PyPI dependencies for CVE-2022-24766?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gcx2-gvj7-pxv3",
"modified" : "2024-10-01T19:30:26Z",
"published" : "2022-03-22T19:22:59Z",
"aliases" : [ "CVE-2022-24766" ],
"summary" : "Insufficient Protection against HTTP Request Smuggling in mitmproxy",
"details" : "### Impact\n\nIn mitmproxy 7.0.4 and below, a malicious client or server is able to perform [HTTP request smuggling](https://en.wikipedia.org/wiki/HTTP_request_smuggling) attacks through mitmproxy. This means that a malicious client/server could smuggle a request/response through mitmproxy as part of another request/response's HTTP message body. While mitmproxy would only see one request, the target server would see multiple requests. A smuggled request is still captured as part of another request's body, but it does not appear in the request list and does not go through the usual mitmproxy event hooks, where users may have implemented custom access control checks or input sanitization.\n\nUnless you use mitmproxy to protect an HTTP/1 service, no action is required.\n\n\n### Patches\n\nThe vulnerability has been fixed in mitmproxy 8.0.0 and above.\n\n\n### Acknowledgements\n\nWe thank Zeyu Zhang (@zeyu2001) for responsibly disclosing this vulnerability to the mitmproxy team.\n\n\n### Timeline\n\n- **2022-03-15**: Received initial report.\n- **2022-03-15**: Verified report and confirmed receipt.\n- **2022-03-16**: Shared patch with researcher.\n- **2022-03-16**: Received confirmation that patch is working.\n- **2022-03-19**: Published patched release and advisory.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "mitmproxy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "8.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mitmproxy/mitmproxy/security/advisories/GHSA-gcx2-gvj7-pxv3"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-24766"
}, {
"type" : "WEB",
"url" : "https://github.com/mitmproxy/mitmproxy/commit/b06fb6d157087d526bd02e7aadbe37c56865c71b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mitmproxy/mitmproxy"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/mitmproxy/PYSEC-2022-170.yaml"
}, {
"type" : "WEB",
"url" : "https://mitmproxy.org/posts/releases/mitmproxy8"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-444" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2022-03-22T19:22:59Z",
"nvd_published_at" : "2022-03-21T19:15:00Z"
}
}