Vulnerabilities in pkg:pypi/mitmproxy

PACKAGE
Advisory Identifier: GHSA-527g-3w9m-29hv
Advisory Summary

CVE-2026-40606 is a MODERATE (CVSS 4.8) mitmproxy has an ldap injection vulnerability (CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')) affecting Mitmproxy libraries in the PyPI ecosystem. The issue involves mitmproxy has an ldap injection. Remediation is available by upgrading affected packages to version 12.2.2.

6 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/mitmproxy

6 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/mitmproxy. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-527g-3w9m-29hv CVE-2026-40606 MODERATE mitmproxy has an LDAP Injection
GHSA-63cx-g855-hvv4 - MODERATE mitmproxy binaries embed a vulnerable python-hyper/h2 dependency
GHSA-wg33-5h85-7q5p CVE-2025-23217 HIGH Mitmweb API Authentication Bypass Using Proxy Server
GHSA-gcx2-gvj7-pxv3 CVE-2022-24766 CRITICAL Insufficient Protection against HTTP Request Smuggling in mitmproxy
GHSA-6m53-c78q-7qmg CVE-2018-14505 CRITICAL Mitmweb in mitmproxy allows DNS Rebinding attacks
GHSA-22gh-3r9q-xf38 CVE-2021-39214 CRITICAL Lacking Protection against HTTP Request Smuggling in mitmproxy

CVE-2026-40606 at a Glance

CVE Identifier CVE-2026-40606
GHSA Identifier GHSA-527g-3w9m-29hv
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection')
Affected Product Mitmproxy
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-40606

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: 12.2.2
pip install mitmproxy>=12.2.2
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-2026-40606, 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 12.2.2), 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-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection'), where the product constructs all or part of an ldap query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended ldap query when it is sent to a downstream component. 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 12.2.1 and below, the builtin LDAP proxy authentication does not correctly sanitize the username when querying the LDAP server. This allows a malicious client to bypass authentication. Only mitmproxy instances using the `proxyauth` option with LDAP are affected. This option is not enabled by default. ### Patches The vulnerability has been fixed in mitmproxy 12.2.2 and above. ### Acknowledgements We thank Yue (Knox) Liu (@yueyueL) for responsibly disclosing this vulnerability to the mitmproxy team. ### Timeline - **2025-12-08**: Received initial report. - **2025-12-09**: Verified report and confirmed receipt. - **2026-01-02**: Informed researcher that patch will be part of the next regular patch release. - **2026-04-12**: Published patch release and advisory.

CVE-2026-40606 Affected Mitmproxy Versions

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

References

Frequently Asked Questions

What is CVE-2026-40606?
CVE-2026-40606 is a security vulnerability in Mitmproxy involving mitmproxy has an LDAP Injection under CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection').
Which Mitmproxy versions are affected?
Affected versions include releases prior to 12.2.2 across affected packages: mitmproxy.
What version fixes CVE-2026-40606?
Upgrading to 12.2.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mitmproxy affected?
Yes, mitmproxy is affected in releases prior to 12.2.2. Upgrade your dependency to 12.2.2 or later.
What is the CVSS score of CVE-2026-40606?
CVE-2026-40606 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-40606?
CVE-2026-40606 is classified under CWE-90: Improper Neutralization of Special Elements used in an LDAP Query ('LDAP Injection') (The product constructs all or part of an LDAP query using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended LDAP query when it is sent to a downstream component.).
How can I check PyPI dependencies for CVE-2026-40606?
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-527g-3w9m-29hv",
  "modified" : "2026-06-06T00:58:36Z",
  "published" : "2026-04-14T01:08:52Z",
  "aliases" : [ "CVE-2026-40606" ],
  "summary" : "mitmproxy has an LDAP Injection",
  "details" : "### Impact\nIn mitmproxy 12.2.1 and below, the builtin LDAP proxy authentication does not correctly sanitize the username when querying the LDAP server. This allows a malicious client to bypass authentication.\n\nOnly mitmproxy instances using the `proxyauth` option with LDAP are affected. This option is not enabled by default.\n\n### Patches\n\nThe vulnerability has been fixed in mitmproxy 12.2.2 and above.\n\n### Acknowledgements\n\nWe thank Yue (Knox) Liu (@yueyueL) for responsibly disclosing this vulnerability to the mitmproxy team.\n\n### Timeline\n\n- **2025-12-08**: Received initial report. \n- **2025-12-09**: Verified report and confirmed receipt.\n- **2026-01-02**: Informed researcher that patch will be part of the next regular patch release.\n- **2026-04-12**: Published patch release and advisory.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mitmproxy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "12.2.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 12.2.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mitmproxy/mitmproxy/security/advisories/GHSA-527g-3w9m-29hv"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40606"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mitmproxy/mitmproxy"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/mitmproxy/PYSEC-2026-92.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-90" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T01:08:52Z",
    "nvd_published_at" : "2026-04-21T18:16:52Z"
  }
}