i2ptunnel: Fix SOCKS 4/4a downgrade bypass of proxy auth

The guard meant to reject SOCKS 4/4a on auth-enabled tunnels checked for legacy
proxyUsername/proxyPassword properties that are no longer used for SOCKS,
we now store sha256 digest under different properties,
so when auth is enabled, a unauthenticated SOCKS 4a CONNECT was accepted.

Fix by removing check for legacy properties.

Reported by: haoxucu
This commit is contained in:
zzz
2026-09-04 08:33:20 -04:00
parent 641f06f48d
commit ff63e0cdff
@@ -50,9 +50,7 @@ class SOCKSServerFactory {
switch (socksVer) {
case 0x04:
// SOCKS version 4/4a
if (Boolean.parseBoolean(props.getProperty(I2PTunnelHTTPClientBase.PROP_AUTH)) &&
props.containsKey(I2PTunnelHTTPClientBase.PROP_USER) &&
props.containsKey(I2PTunnelHTTPClientBase.PROP_PW)) {
if (Boolean.parseBoolean(props.getProperty(I2PTunnelHTTPClientBase.PROP_AUTH))) {
throw new SOCKSException("SOCKS 4/4a not supported when authorization is required");
}
serv = new SOCKS4aServer(ctx, s, props);