diff --git a/component/socks5/socks5.go b/component/socks5/socks5.go index 6c58a848..2950819a 100644 --- a/component/socks5/socks5.go +++ b/component/socks5/socks5.go @@ -229,6 +229,10 @@ func ClientHandshake(rw io.ReadWriter, addr Addr, command Command, user *User) ( } if buf[1] == 2 { + if user == nil { + return nil, ErrAuth + } + // password protocol version authMsg := &bytes.Buffer{} authMsg.WriteByte(1)