proxies: fix a vulnerability in log output

This commit is contained in:
Micooz 2018-06-16 22:20:19 +08:00
parent 07e3e73426
commit 20f634713c

@ -355,7 +355,7 @@ export function createServer({ bindAddress, bindPort, username, password }) {
// Username/Password Authentication
if (isAuthRequired) {
if (username !== request.username || password !== request.password) {
logger.error(`[socks] [${appAddress}] invalid socks5 authorization, username=${request.username} password=${request.password}`);
logger.error(`[socks] [${appAddress}] invalid socks5 authorization username/password, dump=${dumpHex(buffer)}`);
socket.end(Buffer.from([SOCKS_VERSION_V5, 0x01]));
return;
}