CVE-2022-24766: Mitmproxy Insufficient Protection Against HTTP Request Vulnerability

CRITICAL
Advisory Identifier: GHSA-gcx2-gvj7-pxv3
CVSS 9.8
CWE-444
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2022-24766
GHSA Identifier GHSA-gcx2-gvj7-pxv3
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
Affected Product Mitmproxy
Package Ecosystem PyPI
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (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.

mitmproxy fixed: 8.0.0
pip install mitmproxy>=8.0.0
Verify Direct and Transitive Dependencies

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

### Impact In 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. Unless you use mitmproxy to protect an HTTP/1 service, no action is required. ### Patches The vulnerability has been fixed in mitmproxy 8.0.0 and above. ### Acknowledgements We thank Zeyu Zhang (@zeyu2001) for responsibly disclosing this vulnerability to the mitmproxy team. ### Timeline - **2022-03-15**: Received initial report. - **2022-03-15**: Verified report and confirmed receipt. - **2022-03-16**: Shared patch with researcher. - **2022-03-16**: Received confirmation that patch is working. - **2022-03-19**: Published patched release and advisory.

CVE-2022-24766 Affected Mitmproxy Versions

1 component(s)
Fixed Versions:
8.0.0
Product / Package Ecosystem Affected Versions Fixed Version
mitmproxy
PyPI
< 8.0.0
8.0.0

References

Frequently Asked Questions

What is CVE-2022-24766?
CVE-2022-24766 is a security vulnerability in Mitmproxy involving Insufficient Protection against HTTP Request Smuggling in mitmproxy under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling').
Which Mitmproxy versions are affected?
Affected versions include releases prior to 8.0.0 across affected packages: mitmproxy.
What version fixes CVE-2022-24766?
Upgrading to 8.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mitmproxy affected?
Yes, mitmproxy is affected in releases prior to 8.0.0. Upgrade your dependency to 8.0.0 or later.
What is the CVSS score of CVE-2022-24766?
CVE-2022-24766 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2022-24766?
CVE-2022-24766 is classified under CWE-444: Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling') (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.).
How can I check PyPI dependencies for CVE-2022-24766?
Run the dependency tree command: 'pip show mitmproxy'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}