-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signature algorithm selection should match the behaviour of OpenSSH #456
Signature algorithm selection should match the behaviour of OpenSSH #456
Conversation
b2234e2
to
af9c936
Compare
af9c936
to
1fc6d8d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry, but I don't approve this.
We don't enable RSA/SHA1 by default (since it is insecure) and if you have a server that requires it (because it is buggy and breaks when RSA/SHA2 type authentication is attempted), then you should make sure to either remove the RSA/SHA2 algorithms or order RSA/SHA1 with a higher priority than RSA/SHA2 in the PubkeyAcceptedAlgorithms
config (especially considering you already have to modify the PubkeyAcceptedAlgorithms
config to even enable RSA/SHA1 in the first place).
Alternatively, you could create your own UserAuthPublicKey
class that implements the behavior you need and then direct JSch to use it instead of it's built-in implementation by overriding the userauth.publickey
config.
This doesn't enable RSA/SHA1, it only reorders the PubKey in the same manner as OpenSSH when configured. |
Yes, I fully realize that. And that is one of the primary reasons I object this in the first place, since the user already has to explicitly configure |
Also:
|
I opened the MR for easier discussion on a potential solution not as a definitive version, hence the draft state. Regarding the failing test, it actually highlights the solution as there is no server-sig-algos so we could/should use If you feel strongly about not matching the OpenSSH behaviour then that's unfortunate, as it's hard to reason why the command line succeeds but the application doesn't. Appending |
Hi @mvegter, I do feel pretty strongly about this, as it weakens the overall security posture of JSch. Also, I will point out a paragraph from RFC 8332 that I believe you missed:
I would argue that since it has been well over 5 years since RFC 8332 has been published, it has been sufficient period of time for vendors to implement RSA/SHA2 and fully deprecate RSA/SHA1 and clients shouldn't be forced to implement a workaround like this anymore. Thanks, |
Hey @norrisjeremy , I'm fully aware of that section, I based this change on the latest implementation of OpenSSH (9.5) that still has this code : https://github.com/openssh/openssh-portable/blob/V_9_5/sshconnect2.c#L1169-L1180 from OpenSSH (7.8). Which in behaviour matches with the manual attempts I did using a |
Hi @mvegter, That still does not change my opinion: if a user absolutely requires the use of the RSA/SHA1 algorithm (which we do not enable by default in the first place), then the burden must be on them to direct JSch to use it, namely by either explicitly providing it a higher priority (i.e. placing it earlier in the We do not want JSch to make the decision for them to weaken their security, by magically reordering the RSA/SHA1 algorithm to have a higher priority than the RSA/SHA2 algorithms. Thanks, |
Hi @mvegter, Also, now that it is finally public knowledge, another reason I oppose this change is because a malicious attacker could delete an EXT_INFO message from a server containing the Thanks, |
Closes #454