https://bugzilla.mindrot.org/show_bug.cgi?id=3691

            Bug ID: 3691
           Summary: Connection to localhost succeeds with disabled MAC
           Product: Portable OpenSSH
           Version: 9.7p1
          Hardware: amd64
                OS: Other
            Status: NEW
          Severity: normal
          Priority: P5
         Component: sshd
          Assignee: unassigned-b...@mindrot.org
          Reporter: szay...@gmail.com

This testing was done with OpenSSH running on a custom operating system
based on the illumos kernel. However, from what I can tell the issue
observed has little to do with this.

In my test scenario the following change was made to the `sshd_config`
file: `MACs -*md5*,*sha1,*sha1-*,*-96`. When testing from client with
`-m hmac-sha1` results are as expected: `Unable to negotiate with
x.x.x.x port 22: no matching MAC found. Their offer:
umac-64-...@openssh.com,umac-128-...@openssh.com,hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512`.
However, doing the same exact thing on the system with this
configuration, localhost connection succeeds.

It seems on the surface that this inconsistency may be a bug. I expect
to experience the same exact outcome whether or not the connection is
made to `localhost` or from another system on the network.

This is what I am observing with debug output enabled:
----
bsradmin@bsr-6e96de3484:~$ ssh -vv -oPubKeyAuthentication=no -m
hmac-sha1 bsradmin@localhost echo
OpenSSH_9.7p1, OpenSSL 3.0.13 30 Jan 2024
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve;
disabling
debug2: resolving "localhost" port 22
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /home/bsradmin/.ssh/id_rsa type -1
debug1: identity file /home/bsradmin/.ssh/id_rsa-cert type -1
debug1: identity file /home/bsradmin/.ssh/id_ecdsa type 2
debug1: identity file /home/bsradmin/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/bsradmin/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/bsradmin/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/bsradmin/.ssh/id_ed25519 type -1
debug1: identity file /home/bsradmin/.ssh/id_ed25519-cert type -1
debug1: identity file /home/bsradmin/.ssh/id_ed25519_sk type -1
debug1: identity file /home/bsradmin/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/bsradmin/.ssh/id_xmss type -1
debug1: identity file /home/bsradmin/.ssh/id_xmss-cert type -1
debug1: identity file /home/bsradmin/.ssh/id_dsa type -1
debug1: identity file /home/bsradmin/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.7
debug1: Remote protocol version 2.0, remote software version
OpenSSH_9.7
debug1: compat_banner: match: OpenSSH_9.7 pat OpenSSH* compat
0x04000000
debug2: fd 4 setting O_NONBLOCK
debug1: Authenticating to localhost:22 as 'bsradmin'
debug1: load_hostkeys: fopen /home/bsradmin/.ssh/known_hosts2: No such
file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or
directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or
directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: local client KEXINIT proposal
debug2: KEX algorithms:
sntrup761x25519-sha...@openssh.com,curve25519-sha256,curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c,kex-strict-c-...@openssh.com
debug2: host key algorithms:
ssh-ed25519-cert-...@openssh.com,ecdsa-sha2-nistp256-cert-...@openssh.com,ecdsa-sha2-nistp384-cert-...@openssh.com,ecdsa-sha2-nistp521-cert-...@openssh.com,sk-ssh-ed25519-cert-...@openssh.com,sk-ecdsa-sha2-nistp256-cert-...@openssh.com,rsa-sha2-512-cert-...@openssh.com,rsa-sha2-256-cert-...@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25...@openssh.com,sk-ecdsa-sha2-nistp...@openssh.com,rsa-sha2-512,rsa-sha2-256
debug2: ciphers ctos:
aes128-...@openssh.com,aes256-...@openssh.com,chacha20-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
debug2: ciphers stoc:
aes128-...@openssh.com,aes256-...@openssh.com,chacha20-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
debug2: MACs ctos: hmac-sha1
debug2: MACs stoc: hmac-sha1
debug2: compression ctos: none,z...@openssh.com,zlib
debug2: compression stoc: none,z...@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug2: peer server KEXINIT proposal
debug2: KEX algorithms:
sntrup761x25519-sha...@openssh.com,curve25519-sha256,curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-s,kex-strict-s-...@openssh.com
debug2: host key algorithms:
rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
debug2: ciphers ctos:
aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,aes256-...@openssh.com
debug2: ciphers stoc:
aes128-ctr,aes192-ctr,aes256-ctr,aes128-...@openssh.com,aes256-...@openssh.com
debug2: MACs ctos:
umac-64-...@openssh.com,umac-128-...@openssh.com,hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512
debug2: MACs stoc:
umac-64-...@openssh.com,umac-128-...@openssh.com,hmac-sha2-256-...@openssh.com,hmac-sha2-512-...@openssh.com,umac...@openssh.com,umac-...@openssh.com,hmac-sha2-256,hmac-sha2-512
debug2: compression ctos: none
debug2: compression stoc: none
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: kex: algorithm: sntrup761x25519-sha...@openssh.com
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: aes128-...@openssh.com MAC:
<implicit> compression: none
debug1: kex: client->server cipher: aes128-...@openssh.com MAC:
<implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-ed25519
SHA256:7q+g23aV+0MgdL5BlFOG1/iBipJWnOIyOQcXwh0Bk30
debug1: load_hostkeys: fopen /home/bsradmin/.ssh/known_hosts2: No such
file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or
directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or
directory
debug1: Host 'localhost' is known and matches the ED25519 host key.
debug1: Found key in /home/bsradmin/.ssh/known_hosts:4
debug1: ssh_packet_send2_wrapped: resetting send seqnr 3
debug2: ssh_set_newkeys: mode 1
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: Sending SSH2_MSG_EXT_INFO
debug1: expecting SSH2_MSG_NEWKEYS
debug1: ssh_packet_read_poll2: resetting read seqnr 3
debug1: SSH2_MSG_NEWKEYS received
debug2: ssh_set_newkeys: mode 0
debug1: rekey in after 4294967296 blocks
debug2: KEX algorithms:
sntrup761x25519-sha...@openssh.com,curve25519-sha256,curve25519-sha...@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c,kex-strict-c-...@openssh.com
debug2: host key algorithms:
ssh-ed25519-cert-...@openssh.com,ecdsa-sha2-nistp256-cert-...@openssh.com,ecdsa-sha2-nistp384-cert-...@openssh.com,ecdsa-sha2-nistp521-cert-...@openssh.com,sk-ssh-ed25519-cert-...@openssh.com,sk-ecdsa-sha2-nistp256-cert-...@openssh.com,rsa-sha2-512-cert-...@openssh.com,rsa-sha2-256-cert-...@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25...@openssh.com,sk-ecdsa-sha2-nistp...@openssh.com,rsa-sha2-512,rsa-sha2-256
debug2: ciphers ctos:
aes128-...@openssh.com,aes256-...@openssh.com,chacha20-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
debug2: ciphers stoc:
aes128-...@openssh.com,aes256-...@openssh.com,chacha20-poly1...@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
debug2: MACs ctos: hmac-sha1
debug2: MACs stoc: hmac-sha1
debug2: compression ctos: none,z...@openssh.com,zlib
debug2: compression stoc: none,z...@openssh.com,zlib
debug2: languages ctos:
debug2: languages stoc:
debug2: first_kex_follows 0
debug2: reserved 0
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse:
server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25...@openssh.com,sk-ecdsa-sha2-nistp...@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: kex_ext_info_check_ver: publickey-hostbo...@openssh.com=<0>
debug1: kex_ext_info_check_ver: p...@openssh.com=<0>
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_ext_info_client_parse:
server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25...@openssh.com,sk-ecdsa-sha2-nistp...@openssh.com,rsa-sha2-512,rsa-sha2-256>
debug1: Authentications that can continue:
publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req: entering
debug2: input_userauth_info_req: num_prompts 1
(bsradmin@localhost) Password:
debug2: input_userauth_info_req: entering
debug2: input_userauth_info_req: num_prompts 0
Authenticated to localhost ([::1]:22) using "keyboard-interactive".
debug1: channel 0: new session [client-session] (inactive timeout: 0)
debug2: channel 0: send open
debug1: Requesting no-more-sessi...@openssh.com
debug1: Entering interactive session.
debug1: pledge: filesystem
debug1: client_input_global_request: rtype hostkeys...@openssh.com
want_reply 0
debug1: client_input_hostkeys: searching
/home/bsradmin/.ssh/known_hosts for localhost / (none)
debug1: client_input_hostkeys: searching
/home/bsradmin/.ssh/known_hosts2 for localhost / (none)
debug1: client_input_hostkeys: hostkeys file
/home/bsradmin/.ssh/known_hosts2 does not exist
debug1: client_input_hostkeys: no new or deprecated keys from server
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 4 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug1: Sending command: echo
debug2: channel 0: request exec confirm 1
debug1: pledge: fork
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain

debug2: channel 0: obuf empty
debug2: chan_shutdown_write: channel 0: (i0 o1 sock -1 wfd 6 efd 7
[write])
debug2: channel 0: output drain -> closed
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype e...@openssh.com reply
0
debug2: channel 0: rcvd eow
debug2: chan_shutdown_read: channel 0: (i0 o3 sock -1 wfd 5 efd 7
[write])
debug2: channel 0: input open -> closed
debug2: channel 0: rcvd close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2908, received 3704 bytes, in 0.0 seconds
Bytes per second: sent 71411.8, received 90959.2
debug1: Exit status 0
----

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
openssh-bugs mailing list
openssh-bugs@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-bugs

Reply via email to