Skip to content
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

[8.3] - Add fix for CVE-2025-26465 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LucienLassalle
Copy link

@LucienLassalle LucienLassalle commented Feb 24, 2025

A vulnerability was found in OpenSSH when the VerifyHostKeyDNS option is enabled. A machine-in-the-middle attack can be performed by a malicious machine impersonating a legit server.
This issue occurs due to how OpenSSH mishandles err codes in specific conditions when verifying the host key.
For an attack to be considered successful, attacker needs to manage to exhaust the client's memory resource first,
turning the attack complexity high.

In the patch:

  • Added error codes

@LucienLassalle
Copy link
Author

Scratch Build: https://koji.xcp-ng.org/taskinfo?taskID=77232

@stormi stormi requested a review from a team February 24, 2025 12:20
Copy link
Member

@stormi stormi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good from the packaging point of view, but I'm interested in David's or Thierry's review of the patch, with their best "regression detector" on.


/* try another method if we did not send a packet */
- if (sent == 0)
+ if (r == 0 && sent == 0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is part of commit cecee2d607 (client: switch to sshbuf API)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly, but the goal is not to integrate the entire commit, but to integrate only the patch, in this case it was necessary to adapt it so that it works correctly in relation to our code

@LucienLassalle LucienLassalle force-pushed the 8.3-CVE-2025-26465 branch 2 times, most recently from 51650a6 to ebd3161 Compare March 7, 2025 08:39
@LucienLassalle
Copy link
Author

Scratch Build: https://koji.xcp-ng.org/taskinfo?taskID=78977

@LucienLassalle LucienLassalle requested a review from tescande March 7, 2025 08:50
A vulnerability was found in OpenSSH when the VerifyHostKeyDNS option
is enabled. A machine-in-the-middle attack can be performed by a
malicious machine impersonating a legit server.
This issue occurs due to how OpenSSH mishandles err codes in specific
conditions when verifying the host key.
For an attack to be considered successful, attacker needs to manage
to exhaust the client's memory resource first,
turning the attack complexity high.

In the patch:
- Added error codes

Signed-off-by: Lucas RAVAGNIER <[email protected]>
+ (r = sshpkt_put_string(ssh, d, len)) != 0 ||
+ (r = sshpkt_send(ssh)) != 0)
+ return r;
+ break;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The block for case SSH2_MSG_PING: is part of a bigger change dce6d80 (Introduce a transport-level ping facility)

I would recommend to drop this part since you're bringing only part of dce6d80.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand, but this code is part of the fix for the two CVEs reported by Qualys.

Without this code, I'm afraid that CVE-2025-26466 will be exploitable (DoS on Openssh). @bleader what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your patch backports a small part of dce6d80 that implements transport level ping messages SSH2_MSG_PING
and SSH2_MSG_PONG.
So either you backport this entire patch (and then the CVE fix will make sense) or you drop the part of CVE that is concerned. It cannot be half way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants