From f68666d2274c24c019f6a4e9d99e625f60188892 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 23 Dec 2021 13:43:46 +0100 Subject: [PATCH] socks5: fix a (non-critical) off-by-one, fix #4998 --- mitmproxy/proxy/layers/modes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy/proxy/layers/modes.py b/mitmproxy/proxy/layers/modes.py index 40ebfda12..6db401a02 100644 --- a/mitmproxy/proxy/layers/modes.py +++ b/mitmproxy/proxy/layers/modes.py @@ -204,7 +204,7 @@ class Socks5Proxy(DestinationKnown): def state_connect(self): # Parse Connect Request - if len(self.buf) < 4: + if len(self.buf) < 5: return if self.buf[:3] != b"\x05\x01\x00":