RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2209096 - PubkeyAcceptedAlgorithms option of ssh client affect hostkeys insted of pubkeys
Summary: PubkeyAcceptedAlgorithms option of ssh client affect hostkeys insted of pubkeys
Keywords:
Status: CLOSED ERRATA
Alias: None
Deadline: 2023-06-19
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: openssh
Version: 9.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 9.3
Assignee: Dmitry Belyavskiy
QA Contact: Marek Havrila
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-22 15:38 UTC by Marek Havrila
Modified: 2023-11-07 11:24 UTC (History)
2 users (show)

Fixed In Version: openssh-8.7p1-32.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-07 08:52:54 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CRYPTO-10672 0 None None None 2023-05-22 16:12:49 UTC
Red Hat Issue Tracker RHELPLAN-157862 0 None None None 2023-05-22 16:12:54 UTC
Red Hat Product Errata RHBA-2023:6622 0 None None None 2023-11-07 08:53:08 UTC

Comment 11 Jakub Jelen 2023-05-26 08:07:22 UTC
The bug #2068423 mostly talks about the error message, but the root cause is that the crypto policy does not control the client hostkey algorithm list.

This is because the HostKeyAlgorithms option does not limit only selection, but enforces also order, which overrides the default order of hostkeys given by the content of the known_hosts file. Enforncing order of the hostkeys is something that would give most of the users scary warnings about hostkey change.

This was known issue and limitation since  we introduced crypto policies to OpenSSH (I think we even had it documented somewhere, but I can not find it now). I had an upstream bug for this for 5 years with some discussion, but it was never merged [1] that was the reason why we decided to take different approach with Zoltan, to reuse the PubkeyAcceptedAlgorithms (that come from c-p) as it did not require "API"/configuration and crypto policies changes that would be incompatible with the upstream and that would work for most common default configurations and configurations managed by c-p. For the price of potentially "breaking" some very corner cases where the users would explicitly set disjoint algorithm set for PubkeyAcceptedAlgorithms and HostkeyAcceptedAlgrithms.

If you find this confusing, the alternative option is in the upstream bug [1], but it requires modification of c-p and incompatibility with upstream OpenSSH. Do not change the patch to use HostKeyAlgorithms as it would not solve the original issue!

[1] https://bugzilla.mindrot.org/show_bug.cgi?id=2924

Comment 12 Dmitry Belyavskiy 2023-05-26 08:15:17 UTC
Jakub, and would using "-" syntax in CP help?

Comment 13 Jakub Jelen 2023-05-26 10:29:20 UTC
(In reply to Dmitry Belyavskiy from comment #12)
> Jakub, and would using "-" syntax in CP help?

No. Any option (including the - prefix) setting the `HostkeyAcceptedAlgrithms` overrides the default ordering based on local known_hosts file

Comment 14 Norbert Pócs 2023-05-29 08:07:02 UTC
I propose this to be added to the ssh_config man page under HostKeyAlgorithms:

"crypto_policies(7) does not handle the list of algorithms as doing so would break the order given by
 the known_hosts file. Therefore the list is filtered by PubkeyAcceptedAlgorithms."

Any opinions?

Comment 15 Dmitry Belyavskiy 2023-05-29 08:26:16 UTC
LGTM

Comment 26 errata-xmlrpc 2023-11-07 08:52:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (openssh bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6622


Note You need to log in before you can comment on or make changes to this bug.