Open lawmin2021 opened 5 hours ago
I made the following change to pass my case, hope it work for GH-318 Handle cascaded proxy jumps
protected List
}
if (isFound) {
return hops;
}
if (hops.size() > CoreModuleProperties.MAX_PROXY_JUMPS.getRequired(this)) {
throw new IllegalArgumentException("Too many proxy jumps for host " + entry.getHost());
}
}
} catch (IOException | RuntimeException e) {
throw new IllegalArgumentException("Problem parsing proxyJump from host config " + last.getHost(), e);
}
}
} catch (IOException | RuntimeException e) {
throw new IllegalArgumentException("Problem parsing proxyJump from host config " + entry.getHost(), e);
}
return hops;
}
Version
2.13.2
Bug description
the mina sshd 2.13.2 has problem to parse follow code:
private ClientSession getSessionUsingJumpHost( SshClient sshClient, CommandObject commandObject) throws OcmdException, IOException { String hostName = commandObject.getNode(); String user = commandObject.getUser(); int port = Constants.getSSHPort();
}
above code work in mina sshd 2.12.1.
Actual behavior
The Mina SSHD code in SshClient.parseProxyJumps(HostConfigEntry entry, AttributeRepository context) method has an issue with identifying the variable "additionalHops" , and it causes the list object "hops" continuously grow to the maximum limit of 10, and then throw the IlllegalArgumentException.
please check the attached debug images
Expected behavior
I think in SshClient.parseProxyJumps() need to check if the return values of "additionalHops" is already in the "hops", it need to stop and return without throw exception
Relevant log output
No response
Other information
No response