https://bugzilla.mindrot.org/show_bug.cgi?id=3855 Bug ID: 3855 Summary: sshd-auth sandbox Product: Portable OpenSSH Version: 10.0p2 Hardware: ARM OS: Linux Status: NEW Severity: major Priority: P5 Component: sshd Assignee: unassigned-bugs at mindrot.org Reporter: adrian.jarc at aviatnet.com We have recently investigated an issue where once we updated to OpenSSH10.0p2 our integration using wolfProvider (https://github.com/wolfSSL/wolfProvider) for OpenSSL (3.0.12) and wolfSSL (built in FIPS mode) didn't want to authenticate user. During the investigation we have found out that wolfSSLs wolfCrypt module(FIPS140-3 certified) opens file descriptors for /dev/urandom (or /dev/random if there is no urandom) when generating random seed for running KEX algorithms (in our case: diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521). This function stopped working once we upgraded from 9.9p2 to 10.0p2. We investigated and found out that seed generation tries to open file descriptor from the sshd-auth module, which is sandboxed before doing anything, and because of that 4th attempt to open FD fails. So we now made a "patch" that changes lines https://github.com/openssh/openssh-portable/blob/V_10_0/sshd-auth.c#L787-L792 from: " privsep_child_demote(); /* perform the key exchange */ /* authenticate user and start session */ do_ssh2_kex(ssh); do_authentication2(ssh); " to: " /* perform the key exchange */ /* authenticate user and start session */ do_ssh2_kex(ssh); do_authentication2(ssh); privsep_child_demote(); ". Now we are wondering what security issues this might cause, and if there is maybe a better way to fix those limitations that are imposed. WolfSSL team is also investigating this issue but in their case, they were unable to reproduce. In our case it was always successful. WolfSSL also can't easily change their wolfCrypt module, as that would mean they need to recertify everything (this takes a while). If we noticed correctly in our case once privsep_child_demote() function calls ssh_sandbox_child(box). It executes the implementation in: https://github.com/openssh/openssh-portable/blob/V_10_0/sandbox-rlimit.c. System info: uname -a command returns: Linux WTM4800 5.4.134-iproc #1 PREEMPT Tue Jan 25 01:02:13 UTC 2022 armv7l armv7l armv7l GNU/Linux This Linux is a custom Yocto build for our devices. OpenSSH is build with configuration from Yocto repository: https://git.yoctoproject.org/poky/tree/meta/recipes-connectivity/openssh -- You are receiving this mail because: You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2025-Aug-22 07:38 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 Adrian Jarc <adrian.jarc at aviatnet.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|sshd-auth sandbox |sshd-auth sandbox | |limitations -- You are receiving this mail because: You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2025-Aug-22 07:47 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 --- Comment #1 from Adrian Jarc <adrian.jarc at aviatnet.com> --- Sorry, it looks like I added the wrong sandbox implementation file. It seems like it is this one: https://github.com/openssh/openssh-portable/blob/V_10_0/sandbox-seccomp-filter.c -- You are receiving this mail because: You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2025-Aug-28 23:49 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 Damien Miller <djm at mindrot.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |djm at mindrot.org --- Comment #2 from Damien Miller <djm at mindrot.org> --- Moving the privsep_child_demote() to after do_authentication2() not only disables the sandbox (sshd-auth exits after authentication completes), but disables all privilege-reduction that it performs. You're much better off just disabling sandboxing at compile time. Wrt enabling opening /dev/random, unfortunately it's not possible using the seccomp sandbox without also allowing open() of any file. The problem is that the seccomp bpf filters cannot inspect pointer arguments, including file paths. Therefore the only option would be to allow all __NR_open syscalls, which would significantly weaken the sandbox. AFAIK all other libcrypto libraries have long since moved to use the getrandom(2) syscall which is much easier to allowlist. AFAIK BoringSSL's FIPS libcrypto uses getrandom(2). -- You are receiving this mail because: You are watching someone on the CC list of the bug. You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2025-Aug-28 23:55 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 --- Comment #3 from Damien Miller <djm at mindrot.org> --- Some other alternatives: 1. Ask the WolfSSL developers if there is any way to get the library to preopen the file descriptors before the sandbox is applied. 2. Soft-deny all __NR_open syscalls in the sandbox. This will case open() to faill with an error but won't result in a process-killing sandbox violation. You'd need to get a guarantee from the WolfSSL developers that their library will perform safely in this situation. -- You are receiving this mail because: You are watching someone on the CC list of the bug. You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2025-Aug-29 08:51 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 --- Comment #4 from Adrian Jarc <adrian.jarc at aviatnet.com> --- (In reply to Damien Miller from comment #2)> Moving the privsep_child_demote() to after do_authentication2() not > only disables the sandbox (sshd-auth exits after authentication > completes), but disables all privilege-reduction that it performs. > You're much better off just disabling sandboxing at compile time. > > Wrt enabling opening /dev/random, unfortunately it's not possible > using the seccomp sandbox without also allowing open() of any file. > The problem is that the seccomp bpf filters cannot inspect pointer > arguments, including file paths. Therefore the only option would be > to allow all __NR_open syscalls, which would significantly weaken > the sandbox. > > AFAIK all other libcrypto libraries have long since moved to use the > getrandom(2) syscall which is much easier to allowlist. AFAIK > BoringSSL's FIPS libcrypto uses getrandom(2).As far as BoringSSL goes, it is not certified for our processor. And also we have made some further investigation and found that if we move privsep_child_demote() after do_ssh2_kex() also works, as the problem was in kex authentication. Is this any better? -- You are receiving this mail because: You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at mindrot.org
2025-Aug-29 08:53 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 --- Comment #5 from Adrian Jarc <adrian.jarc at aviatnet.com> --- (In reply to Damien Miller from comment #3)> Some other alternatives: > > 1. Ask the WolfSSL developers if there is any way to get the library > to preopen the file descriptors before the sandbox is applied. > 2. Soft-deny all __NR_open syscalls in the sandbox. This will case > open() to faill with an error but won't result in a process-killing > sandbox violation. You'd need to get a guarantee from the WolfSSL > developers that their library will perform safely in this situation.If WolfSSL changes how that works, their wolfCrypt module won't be FIPS certified anymore, and that does not help. So this is not an option. As for 2. point, can we get some pointers as how we could do that? -- You are receiving this mail because: You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at mindrot.org
2025-Aug-31 23:39 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 --- Comment #6 from Damien Miller <djm at mindrot.org> --- (In reply to Adrian Jarc from comment #5)> If WolfSSL changes how that works, their wolfCrypt module won't be > FIPS certified anymore, and that does not help. So this is not an > option.No, what I mean is asking if there are any existing WolfSSL API calls that can be made to prepare it for sandboxing.> As for 2. point, can we get some pointers as how we could do that?You'll need to identify the syscall that is failing. If you build OpenSSH with the SANDBOX_SECCOMP_FILTER_DEBUG define set in sandbox-seccomp-filter.c (don't use this in production) you'll get an error message including the syscall number. -- You are receiving this mail because: You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at mindrot.org
2025-Sep-01 07:10 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 --- Comment #7 from Adrian Jarc <adrian.jarc at aviatnet.com> --- (In reply to Damien Miller from comment #6)> (In reply to Adrian Jarc from comment #5) > > > If WolfSSL changes how that works, their wolfCrypt module won't be > > FIPS certified anymore, and that does not help. So this is not an > > option. > > No, what I mean is asking if there are any existing WolfSSL API > calls that can be made to prepare it for sandboxing. > > > As for 2. point, can we get some pointers as how we could do that? > > You'll need to identify the syscall that is failing. If you build > OpenSSH with the SANDBOX_SECCOMP_FILTER_DEBUG define set in > sandbox-seccomp-filter.c (don't use this in production) you'll get > an error message including the syscall number.I have enabled debug logging, and this is the debug log I get on server where it fails: " 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug3: fd 8 is not O_NONBLOCK 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug2: fd 9 setting O_NONBLOCK 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug1: Forked child 5500. 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.5500 debug3: oom_adjust_restore 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.5500 debug1: Set /proc/self/oom_score_adj to 0 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.5500 debug1: rexec start in 8 out 8 newsock 8 config_s 9/10 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug2: server_accept_loop: child 5500 for connection from <client-ip> to <server-ip> received config 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: network sockets: 7, 7 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: server_process_channel_timeouts: setting 0 timeouts 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: channel_clear_timeouts: clearing 2025-09-01T09:00:58.519+00:00 Chassis1 auth.info WTM4800 sshd-session.5500 Connection from <client-ip> port 34166 on <server-ip> port 22 rdomain "" 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: Local version string SSH-2.0-OpenSSH_10.0 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: Remote protocol version 2.0, remote software version OpenSSH_9.6p1 Ubuntu-3ubuntu13.13 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: compat_banner: match: OpenSSH_9.6p1 Ubuntu-3ubuntu13.13 pat OpenSSH* compat 0x04000000 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: fd 7 setting O_NONBLOCK 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: Network child is on pid 5502 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: preauth child monitor started 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_request_receive: entering 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: monitor_read: checking request 51 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: mm_answer_state: config len 3640 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_request_send: entering, type 52 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_answer_state: done 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: monitor_read: 51 used once, disabling now 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: server_process_channel_timeouts: setting 0 timeouts [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: channel_clear_timeouts: clearing [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: fd 5 is O_NONBLOCK [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: ssh_sandbox_init: preparing seccomp filter sandbox [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: privsep user:group 997:996 [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: permanently_set_uid: 997/996 [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: ssh_sandbox_child_debugging: installing SIGSYS handler [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: ssh_sandbox_child: setting PR_SET_NO_NEW_PRIVS [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: ssh_sandbox_child: attaching seccomp filter program [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: ssh_sandbox_child: prctl(PR_SET_SECCOMP): Invalid argument [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: append_hostkey_type: ssh-rsa key not permitted by HostkeyAlgorithms [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256 [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: send packet: type 20 [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: SSH2_MSG_KEXINIT sent [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: receive packet: type 20 [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: SSH2_MSG_KEXINIT received [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: local server KEXINIT proposal [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: KEX algorithms: diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,ext-info-s,kex-strict-s-v00 at openssh.com [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256 [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: ciphers ctos: aes128-ctr,aes128-gcm at openssh.com,aes256-ctr,aes256-gcm at openssh.com [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: ciphers stoc: aes128-ctr,aes128-gcm at openssh.com,aes256-ctr,aes256-gcm at openssh.com [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: MACs ctos: hmac-sha2-256,hmac-sha2-512 [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: MACs stoc: hmac-sha2-256,hmac-sha2-512 [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: compression ctos: none,zlib at openssh.com [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: compression stoc: none,zlib at openssh.com [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: languages ctos: [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: languages stoc: [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: first_kex_follows 0 [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: reserved 0 [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: peer client KEXINIT proposal [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: KEX algorithms: sntrup761x25519-sha512 at openssh.com,curve25519-sha256,curve25519-sha256 at 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-v00 at openssh.com [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: host key algorithms: ssh-ed25519-cert-v01 at openssh.com,ecdsa-sha2-nistp256-cert-v01 at openssh.com,ecdsa-sha2-nistp384-cert-v01 at openssh.com,ecdsa-sha2-nistp521-cert-v01 at openssh.com,sk-ssh-ed25519-cert-v01 at openssh.com,sk-ecdsa-sha2-nistp256-cert-v01 at openssh.com,rsa-sha2-512-cert-v01 at openssh.com,rsa-sha2-256-cert-v01 at openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519 at openssh.com,sk-ecdsa-sha2-nistp256 at openssh.com,rsa-sha2-512,rsa-sha2-256 [preaut 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: ciphers ctos: chacha20-poly1305 at openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm at openssh.com,aes256-gcm at openssh.com [preauth] 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: ciphers stoc: chacha20-poly1305 at openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm at openssh.com,aes256-gcm at openssh.com [preauth] 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: MACs ctos: umac-64-etm at openssh.com,umac-128-etm at openssh.com,hmac-sha2-256-etm at openssh.com,hmac-sha2-512-etm at openssh.com,hmac-sha1-etm at openssh.com,umac-64 at openssh.com,umac-128 at openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth] 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: MACs stoc: umac-64-etm at openssh.com,umac-128-etm at openssh.com,hmac-sha2-256-etm at openssh.com,hmac-sha2-512-etm at openssh.com,hmac-sha1-etm at openssh.com,umac-64 at openssh.com,umac-128 at openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth] 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: compression ctos: none,zlib at openssh.com,zlib [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: compression stoc: none,zlib at openssh.com,zlib [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: languages ctos: [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: languages stoc: [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: first_kex_follows 0 [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: reserved 0 [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: kex_choose_conf: will use strict KEX ordering [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: kex: algorithm: ecdh-sha2-nistp256 [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: receive packet: type 30 [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: SSH2_MSG_KEX_ECDH_INIT received [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.info WTM4800 sshd-session.5500 ssh_dispatch_run_fatal: Connection from <client-ip> port 34166: error in libcrypto [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: monitor_read_log: child log fd closed 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_request_receive: entering 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_request_receive: monitor fd closed 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: mm_reap: preauth child exited with status 255 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: do_cleanup 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: PAM: sshpam_thread_cleanup entering 2025-09-01T09:00:58.641+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: Killing privsep child 5502 2025-09-01T09:00:58.645+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug1: child_close: enter 2025-09-01T09:00:58.645+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug1: child_reap: preauth child 5500 for connection from <client-ip> to <server-ip> exited with status 255 2025-09-01T09:00:58.645+00:00 Chassis1 auth.info WTM4800 sshd.29539 srclimit_penalise: ipv4: new <client-ip>/32 deferred penalty of 1 seconds for penalty: connections without attempting authentication 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug3: fd 8 is not O_NONBLOCK 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug2: fd 9 setting O_NONBLOCK 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug1: Forked child 5500. 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.5500 debug3: oom_adjust_restore 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.5500 debug1: Set /proc/self/oom_score_adj to 0 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.5500 debug1: rexec start in 8 out 8 newsock 8 config_s 9/10 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug2: server_accept_loop: child 5500 for connection from <client-ip> to <server-ip> received config 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: network sockets: 7, 7 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: server_process_channel_timeouts: setting 0 timeouts 2025-09-01T09:00:58.493+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: channel_clear_timeouts: clearing 2025-09-01T09:00:58.519+00:00 Chassis1 auth.info WTM4800 sshd-session.5500 Connection from <client-ip> port 34166 on <server-ip> port 22 rdomain "" 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: Local version string SSH-2.0-OpenSSH_10.0 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: Remote protocol version 2.0, remote software version OpenSSH_9.6p1 Ubuntu-3ubuntu13.13 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: compat_banner: match: OpenSSH_9.6p1 Ubuntu-3ubuntu13.13 pat OpenSSH* compat 0x04000000 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: fd 7 setting O_NONBLOCK 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: Network child is on pid 5502 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: preauth child monitor started 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_request_receive: entering 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: monitor_read: checking request 51 2025-09-01T09:00:58.519+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: mm_answer_state: config len 3640 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_request_send: entering, type 52 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_answer_state: done 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: monitor_read: 51 used once, disabling now 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: server_process_channel_timeouts: setting 0 timeouts [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: channel_clear_timeouts: clearing [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: fd 5 is O_NONBLOCK [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: ssh_sandbox_init: preparing seccomp filter sandbox [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: privsep user:group 997:996 [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: permanently_set_uid: 997/996 [preauth] 2025-09-01T09:00:58.561+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: ssh_sandbox_child_debugging: installing SIGSYS handler [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: ssh_sandbox_child: setting PR_SET_NO_NEW_PRIVS [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: ssh_sandbox_child: attaching seccomp filter program [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: ssh_sandbox_child: prctl(PR_SET_SECCOMP): Invalid argument [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: append_hostkey_type: ssh-rsa key not permitted by HostkeyAlgorithms [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256 [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: send packet: type 20 [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: SSH2_MSG_KEXINIT sent [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: receive packet: type 20 [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: SSH2_MSG_KEXINIT received [preauth] 2025-09-01T09:00:58.565+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: local server KEXINIT proposal [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: KEX algorithms: diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,ext-info-s,kex-strict-s-v00 at openssh.com [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256 [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: ciphers ctos: aes128-ctr,aes128-gcm at openssh.com,aes256-ctr,aes256-gcm at openssh.com [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: ciphers stoc: aes128-ctr,aes128-gcm at openssh.com,aes256-ctr,aes256-gcm at openssh.com [preauth] 2025-09-01T09:00:58.588+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: MACs ctos: hmac-sha2-256,hmac-sha2-512 [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: MACs stoc: hmac-sha2-256,hmac-sha2-512 [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: compression ctos: none,zlib at openssh.com [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: compression stoc: none,zlib at openssh.com [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: languages ctos: [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: languages stoc: [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: first_kex_follows 0 [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: reserved 0 [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: peer client KEXINIT proposal [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: KEX algorithms: sntrup761x25519-sha512 at openssh.com,curve25519-sha256,curve25519-sha256 at 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-v00 at openssh.com [preauth] 2025-09-01T09:00:58.607+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: host key algorithms: ssh-ed25519-cert-v01 at openssh.com,ecdsa-sha2-nistp256-cert-v01 at openssh.com,ecdsa-sha2-nistp384-cert-v01 at openssh.com,ecdsa-sha2-nistp521-cert-v01 at openssh.com,sk-ssh-ed25519-cert-v01 at openssh.com,sk-ecdsa-sha2-nistp256-cert-v01 at openssh.com,rsa-sha2-512-cert-v01 at openssh.com,rsa-sha2-256-cert-v01 at openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519 at openssh.com,sk-ecdsa-sha2-nistp256 at openssh.com,rsa-sha2-512,rsa-sha2-256 [preaut 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: ciphers ctos: chacha20-poly1305 at openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm at openssh.com,aes256-gcm at openssh.com [preauth] 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: ciphers stoc: chacha20-poly1305 at openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm at openssh.com,aes256-gcm at openssh.com [preauth] 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: MACs ctos: umac-64-etm at openssh.com,umac-128-etm at openssh.com,hmac-sha2-256-etm at openssh.com,hmac-sha2-512-etm at openssh.com,hmac-sha1-etm at openssh.com,umac-64 at openssh.com,umac-128 at openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth] 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: MACs stoc: umac-64-etm at openssh.com,umac-128-etm at openssh.com,hmac-sha2-256-etm at openssh.com,hmac-sha2-512-etm at openssh.com,hmac-sha1-etm at openssh.com,umac-64 at openssh.com,umac-128 at openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth] 2025-09-01T09:00:58.614+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: compression ctos: none,zlib at openssh.com,zlib [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: compression stoc: none,zlib at openssh.com,zlib [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: languages ctos: [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: languages stoc: [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: first_kex_follows 0 [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug2: reserved 0 [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: kex_choose_conf: will use strict KEX ordering [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: kex: algorithm: ecdh-sha2-nistp256 [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none [preauth] 2025-09-01T09:00:58.632+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: receive packet: type 30 [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: SSH2_MSG_KEX_ECDH_INIT received [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.info WTM4800 sshd-session.5500 ssh_dispatch_run_fatal: Connection from <client-ip> port 34166: error in libcrypto [preauth] 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: monitor_read_log: child log fd closed 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_request_receive: entering 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: mm_request_receive: monitor fd closed 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: mm_reap: preauth child exited with status 255 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: do_cleanup 2025-09-01T09:00:58.635+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug3: PAM: sshpam_thread_cleanup entering 2025-09-01T09:00:58.641+00:00 Chassis1 auth.debug WTM4800 sshd-session.5500 debug1: Killing privsep child 5502 2025-09-01T09:00:58.645+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug1: child_close: enter 2025-09-01T09:00:58.645+00:00 Chassis1 auth.debug WTM4800 sshd.29539 debug1: child_reap: preauth child 5500 for connection from <client-ip> to <server-ip> exited with status 255 2025-09-01T09:00:58.645+00:00 Chassis1 auth.info WTM4800 sshd.29539 srclimit_penalise: ipv4: new <client-ip>/32 deferred penalty of 1 seconds for penalty: connections without attempting authentication " Also, I can tell you that wolfSSL fails in lines: https://github.com/wolfSSL/wolfssl/blob/v5.6.4-stable/wolfcrypt/src/random.c#L3690-L3695 -- You are receiving this mail because: You are watching someone on the CC list of the bug. You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2025-Sep-01 23:40 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 --- Comment #8 from Damien Miller <djm at mindrot.org> --- Please don't paste logs in the comment box, it makes bugs hard to read. Use the attachment feature instead. I don't see a sandbox violation there. If I had to guess what's happening I'd say that WolfSSL is attempting open(/dev/urandom), soft-failing with errno==EACCESS because of https://github.com/openssh/openssh-portable/blob/master/sandbox-seccomp-filter.c#L259 and returning a failure that terminates the sshd-auth process. Reiterating your options: 1. Ask the WolfSSL developers if you can get it to prepare for sandboxing before the sandbox is applied. In other libraries, this usually means making some API call that loads a seed or opens a file descriptor before the sandbox makes such things impossible. 2. Get WolfSSL to use getrandom() instead of open(/dev/urandom). It looks like there is already support in the library for this: https://github.com/wolfSSL/wolfssl/blob/v5.6.4-stable/wolfcrypt/src/random.c#L3595-L3624 3. Change the sandbox to allow the open syscall. This would significantly weaken the sandbox as it can't be done selectively per-path, which is why we don't do it in OpenSSH. Practically, this means replacing "SC_DENY(__NR_open, EACCES)," with "SC_ALLOW(__NR_open)," -- You are receiving this mail because: You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at mindrot.org
2025-Sep-02 04:25 UTC
[Bug 3855] sshd-auth sandbox limitations
https://bugzilla.mindrot.org/show_bug.cgi?id=3855 --- Comment #9 from Adrian Jarc <adrian.jarc at aviatnet.com> --- (In reply to Damien Miller from comment #8)> Please don't paste logs in the comment box, it makes bugs hard to > read. Use the attachment feature instead. > > I don't see a sandbox violation there. If I had to guess what's > happening I'd say that WolfSSL is attempting open(/dev/urandom), > soft-failing with errno==EACCESS because of > https://github.com/openssh/openssh-portable/blob/master/sandbox- > seccomp-filter.c#L259 and returning a failure that terminates the > sshd-auth process. > > Reiterating your options: > > 1. Ask the WolfSSL developers if you can get it to prepare for > sandboxing before the sandbox is applied. In other libraries, this > usually means making some API call that loads a seed or opens a file > descriptor before the sandbox makes such things impossible. > > 2. Get WolfSSL to use getrandom() instead of open(/dev/urandom). It > looks like there is already support in the library for this: > https://github.com/wolfSSL/wolfssl/blob/v5.6.4-stable/wolfcrypt/src/ > random.c#L3595-L3624 > > 3. Change the sandbox to allow the open syscall. This would > significantly weaken the sandbox as it can't be done selectively > per-path, which is why we don't do it in OpenSSH. Practically, this > means replacing "SC_DENY(__NR_open, EACCES)," with > "SC_ALLOW(__NR_open),"I apologise for attaching full logs in comment box, I have completely missed the add attachment option. Will keep in mind if there will be a next time. Since the whole purpose of writing this to you, was to avoid lowering security of sandbox, I will try to avoid the 3. option. So I have written to wolfSSL about options 1. and 2.. Hopefully I will get a reply soon. I wrote to you, because ever since finding out what issue happens with wolfSSL they have become silent. Now that you have helped me find some additional possible solutions, I have written to them again and am waiting for a reply. I am leaving this issue open until I get some reply from wolfSSL. I will close it after they respond. Thank you for your help. You have been very helpful. -- You are receiving this mail because: You are watching the assignee of the bug. You are watching someone on the CC list of the bug.