mitmproxy
CVE-2026-40606
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessConnect to mitmproxy proxy port
-
DeliverySend LDAP injection payload in username field
-
ExploitInjected username modifies LDAP filter logic
-
ExecutionAuthentication check bypassed
-
ImpactUnauthorized proxy access granted
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization LDAP query parameterization
MITRE ATT&CK
1 technique across 1 tactic: Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The LDAP proxyauth option must be explicitly enabled and configured in mitmproxy. Specifically, the proxyauth setting must use LDAP as the authentication backend, which is NOT the default configuration. Remote attackers can connect to the proxy port without pre-existing authentication, and the vulnerability exploits the LDAP filter construction during the authentication handshake. Non-LDAP authentication methods and default configurations (proxyauth disabled) are not affected. The attack occurs during the client's initial connection and authentication phase. |
| Impact | This vulnerability presents moderate risk with important context: CVSS 4.8 with network attack vector (AV:N), high complexity (AC:H), no privileges required (PR:N), and no user interaction needed reflects the baseline severity. However, the real-world risk is significantly constrained by the fact that the LDAP proxyauth option is not enabled by default-only organizations that have explicitly configured LDAP authentication are affected. The AC:H (high complexity) rating suggests the exploitation requires specific conditions or crafted input, which aligns with the LDAP injection nature. No KEV status or active exploitation data is provided, indicating this may be a responsibly disclosed vulnerability without public active exploitation at time of analysis. Organizations using default mitmproxy configurations face zero risk; those using LDAP authentication should prioritize patching. The combination of network accessibility but non-default configuration makes this a targeted rather than widespread risk. |
| Exploit ScenarioDerived | An attacker crafts a malicious LDAP filter string as the username when connecting to a mitmproxy instance configured with LDAP proxyauth (e.g., username: 'admin*)(|(uid=*' or similar injection payload). The unsanitized username is inserted into the LDAP query, modifying the filter logic to bypass authentication checks and allow the attacker to access proxied traffic without valid credentials. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 21, 2026
Authentication bypass in mitmproxy 12.2.1 and below allows remote attackers to bypass LDAP-based proxy authentication through unsanitized username injection. The vulnerability affects only instances explicitly configured with the proxyauth option using LDAP authentication, which is disabled by default. Attackers can exploit this over the network without authentication or user interaction to gain unauthorized access to proxied connections.
RemediationAI
Upgrade mitmproxy to version 12.2.2 or above, which contains the fix for LDAP username sanitization. Organizations unable to upgrade immediately should disable the proxyauth LDAP feature if not critical to operations, or implement a non-LDAP authentication method. Additional compensating controls include restricting network access to the mitmproxy proxy port using firewall rules to limit which clients can reach the authentication endpoint, though this may impact legitimate use cases. Verify the upgrade using the GitHub security advisory GHSA-527g-3w9m-29hv.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
mitmproxy's builtin LDAP proxy authentication mechanism (enabled via the proxyauth option with LDAP configuration) constructs LDAP queries using client-supplied usernames without proper sanitization. The vulnerability root cause is CWE-90 (Improper Neutralization of Special Elements used in an LDAP Query), allowing attackers to inject LDAP filter syntax into authentication queries. This enables bypassing the authentication check by manipulating the LDAP filter logic, similar to SQL injection attacks but targeting LDAP directory services. The affected component is the LDAP authentication handler in mitmproxy's proxy authentication subsystem.
Know when Mitmproxy gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
Lifecycle Timeline
2DescriptionGitHub Advisory
mitmproxy is a interactive TLS-capable intercepting HTTP proxy for penetration testers and software developers and mitmweb is a web-based interface for mitmproxy. 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. The vulnerability has been fixed in mitmproxy 12.2.2 and above.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.
Affected Products (CPE)GitHub Advisory
mitmweb in mitmproxy v4.0.3 allows DNS Rebinding attacks, related to tools/web/app.py. Rated high severity (CVSS 8.8), t
mitmproxy is an interactive, SSL/TLS-capable intercepting proxy. Rated critical severity (CVSS 9.8), this vulnerability
mitmproxy is an interactive, SSL/TLS-capable intercepting proxy. Rated critical severity (CVSS 9.8), this vulnerability
Same weakness CWE-90 – LDAP Injection
View allSame technique Authentication Bypass
View allVendor StatusVendor
SUSE
Severity: Medium| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB