mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-16 00:10:00 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user