100 Commits
Author SHA1 Message Date
Damien Miller f78fc73d31 version 2026-11-05 10:57:15 +11:00
Damien Miller 3e29b958f6 RPM specs 2026-11-05 10:56:59 +11:00
Damien Miller c5cd8e8ccf depend 2026-11-05 08:58:10 +11:00
Damien Miller 4353fdc43e avoid password authn bypass
This bypass affects some configurations and runtime configurations.
We do not consider the root cause to be within OpenSSH but we are
well equipped to avoid it.
2026-11-05 08:57:56 +11:00
Damien Miller c27bc66a8c fix arguable off-by-one in password expiry check
Old behaviour was to allow upto and including the expiry day, but this changes
it to allow upto but _not_ including which apparently matches some other tools
and libraries (e.g. Linux-PAM pam_unix.so).

Anthropic ANT-2026-V1VNLWUV
2026-10-30 19:33:20 +11:00
Damien Miller 976332e15e check IP options from IPv4-mapped IPv6 addrs too
Anthropic ANT-2026-MUH7FLBQ
2026-10-30 19:02:51 +11:00
Damien Miller 74551008cc fix BROKEN_SNPRINTF replacement for max-width ints
Previous implementation incorrectly truncating integers that needed more
than 19 decimal places.

Anthropic ANT-2026-LRFWCWHP
2026-10-30 18:56:22 +11:00
Damien Miller 84f8f4666b fix fake password salt generation for bcrypt hashes
When an invalid user is being considered for non-PAM password authentication,
sshd will generate a fake passwd/salt to hide timing differences in crypt(3)
or similar. To do this, it uses the salt algorithm from the first valid
account in the password database, but the approach we were using failed to
correctly match bcrypt hashes. So, if the password database only contained
bcrypt hashes, then the timing difference between a valid and invalid user
would again be visible.

Anthropic ANT-2026-7T6M8N4X
2026-10-30 17:49:48 +11:00
Damien Miller 5f707ab7f9 harden seccomp sandbox wrt clock syscalls
Restrict the clock syscalls' first argument to positive clock IDs only.
Negative clock IDs represent other processes' clocks.

This avoids a compromised unpriv process from probing other PIDs and
their clocks and/or blocking on their clocks.

Anthropic ANT-2026-UQT74MC0
2026-10-30 15:41:33 +11:00
Damien Miller 46ea127558 disallow non-MAP_ANON mmap(2) in seccomp sandbox
harden sandbox by disallowing non-anonymous mappings

Anthropic ANT-2026-DVPHBUJ2
2026-10-30 13:05:03 +11:00
Damien Miller 07ffcabecb don't allow the mmap(2) syscall on Linux/i386
apparently this maps to old_mmap() which uses indirect flags passing that
we can't inspect. The mmap2(2) syscall (that we can inspect) is also supported
and used by glibc on this platform so this should be okay.

Anthropic ANT-2026-AQZ97XUN
2026-10-30 12:49:22 +11:00
Damien Miller 9764831719 update glob.c from upstream OpemBSD libc
revision 1.51
date: 2026/10/24 18:08:57;  author: millert;  state: Exp;  lines: +12 -1;  commitid: eQplLAFWij3oMfPf;
Fix out-of-bounds read on on missing right bracket after character class.

The original code checked for a closing bracket before parsing the
bracket expression.  When character class support was added, that
closing bracket can now be part of the character class instead.
Add another check for the closing bracket after parsing character
classes and roll back if we don't find one.

Adapted from an OpenSSH bug report.  OK djm@
2026-10-26 16:16:12 +11:00
Damien Miller 26b1363c7c allow restart_syscall(2) in seccomp sandbox
bz4036, from Chester Weber
ok dtucker@
2026-10-18 19:24:30 +08:00
Damien Miller 6545e6a55d another readpassphrase() fix from OpenBSD libc
revision 1.32
date: 2026/10/15 16:40:50;  author: millert;  state: Exp;  lines: +2 -2;  commitid: PeYLMhPn3x9iWE37;
Don't print newline after reading password if interrupted by signal.
Avoids an extra newline when the user presses ^C or ^\ at the
password prompt.  OK deraadt@
2026-10-16 17:13:41 +11:00
Damien Miller aaa084361b typo 2026-10-15 17:38:40 +11:00
Damien Miller e8a84e5dbf readpassphrase.c fix from OpenBSD
revision 1.31
date: 2026/10/15 05:55:06;  author: djm;  state: Exp;  lines: +5 -5;  commitid: EQzOxkBlPs867NeQ;
fix weird behaviour after SIGINT/SIGQUIT caused by my previous
signal handling change. Feedback deraadt/millert; ok deraadt
2026-10-15 16:57:47 +11:00
Damien Miller d551375fa9 fix bad test in !HAVE_OPENAT fallback path 2026-10-14 15:22:08 +11:00
Damien Miller 0f6c02cb2d fix incorrect string comparison length 2026-10-14 15:11:05 +11:00
Damien Miller 25e0d74adf fix incorrect warning message under SKIP_PRIVDROP 2026-10-14 15:09:59 +11:00
Damien Miller 79e346f973 downgrade pointer-qualifier error
Don't error on -Wincompatible-pointer-types-discards-qualifiers warnings
when -Werror is set.
2026-10-14 09:00:47 +05:30
Damien Miller c5fa43c582 unbreak SKIP_PRIVDROP case 2026-10-14 09:00:23 +05:30
Damien Miller ab81aba07e avoid ksh-ism in regress test 2026-10-06 19:44:50 +11:00
Damien Miller fdda125f53 .depend 2026-10-06 19:01:18 +11:00
Damien Miller ce43722bcc update RPM spec files 2026-10-06 18:57:28 +11:00
Damien Miller ac6ad1afd1 remove the --disable-fd-passing configure option
Also add a deprecation warning when the lack FD passing support and also
requires root for the post-auth sshd-session process
2026-10-06 16:50:50 +11:00
Damien Miller b37c095aa3 disable features when post-auth sshd runs as root
On platforms that require root privilege for the post-authentication
sshd-session process (e.g. OpenServer 5, QNX 6), disable and restrict
a number of features that assume user privilege.

This includes GatewayPorts, StreamLocalForwarding and -R forwardings
binding to ports <1024
2026-10-06 16:50:34 +11:00
Damien Miller e3cb2b2278 unbreak readpassphrase.c sync 2026-09-16 12:28:40 +10:00
Damien Miller 58db2ec9ca sync readpassphrase(3) with OpenBSD libc
Should fix bz3995: ssh-add spins when started in a background group,
with no controlling tty and with certain signals ignored.
2026-09-16 11:26:40 +10:00
Damien Miller ae7373dfe1 fix merge botch that put lines in wrong function
sdirent_cmp() looked similar enough to sglob_cmp() for patch
2026-09-15 21:17:51 +10:00
Damien Miller 563087a648 sshd doesn't need sshpty.c any more 2026-09-15 17:00:01 +10:00
Damien Miller 78db1b7e9f allow madvise(..., MADV_DONTNEED_LOCKED)
allow MADV_DONTNEED_LOCKED in the seccomp sandbox; needed by GrapheneOS'
hardened allocator. bz4001
2026-09-15 15:37:02 +10:00
Damien Miller 7fe3b24c92 set -Wno-error=discarded-qualifiers
Disable this as a compilation error for -Werror builds until we
clean them all up.
2026-09-04 00:16:30 +10:00
Damien Miller 769728b835 seccomp sandbox: restrict mremap flags
In the seccomp sandbox, restrict use of mremap(2) to only permit
its use with the MREMAP_MAYMOVE flag and specifically not the
MREMAP_FIXED flag, as the latter may have some use as part of an
attack chain.

Reported by: Mohammad Hossein Abedini <mhmd.abedinii@gmail.com>

ok deraadt@
2026-09-03 14:14:37 +10:00
Damien Miller c66bef01e1 allow PAMServiceName in Match (regressed in 10.4)
During the refactor of server option parsing, the ability to set
PAMServiceName in Match blocks was accidentally disabled.

Reported by Kanishka De Silva; ok markus
2026-09-01 15:52:38 +10:00
Damien Miller 83e41449cd special treatment for a more Turkic languages
Azerbaijani and Crimean Tatar also have the i/I problem.

bz3991; ok dtucker
2026-08-20 11:20:34 +10:00
Damien Miller 9f279dd513 whitespace at eol 2026-08-12 09:29:31 +10:00
Damien Miller 77337b8a6d depend 2026-08-11 12:21:59 +10:00
Damien Miller 772a5b728e update version 2026-08-11 12:21:12 +10:00
Damien Miller 8e65f996e5 remove README.tun
it's badly out of date, has already been deleted upstream and is not
well-adapted for portable.
2026-07-08 11:07:01 +10:00
Damien Miller b9e2a1f923 add some parentheses to clarify a && || condition
Spotted by Harish Yadav
2026-07-08 10:27:56 +10:00
Damien Miller 449d25b4f8 depend 2026-07-06 17:56:53 +10:00
Damien Miller 0227fe4606 crank version numbers 2026-07-06 17:56:10 +10:00
Damien Miller aab5620a66 grammar fix; from Daniel O'Connor 2026-07-03 14:20:02 +10:00
Damien Miller c123ac1c57 more config option details in README.privsep 2026-07-03 14:16:29 +10:00
Damien Miller 3912be7baa more README.privsep polish 2026-07-03 14:10:16 +10:00
Damien Miller f80e6545ee tweak; from dlg@ 2026-07-03 13:33:16 +10:00
Damien Miller 01ed1c648a tweak previous 2026-07-03 12:49:26 +10:00
Damien Miller 85dcff277e revise README.privsep for multi-binary model
This rewrites most of the privsep description to more accurately capture
recent changes in how sshd managed privilege across its lifecycle,
including describing the roles of the sshd-session and sshd-auth
helper binaries.

Also 100% more ASCII art
2026-07-03 12:31:27 +10:00
Damien Miller 365522938f don't leak rrset on fail; GHPR681 from metsw24-max
ok dtucker
2026-06-29 17:45:23 +10:00
Damien Miller fceb78d14a check sockaddr length; GHPR681 from metsw24-max
ok dtucker
2026-06-29 17:45:20 +10:00
Damien Miller 9d5238f44d return result of raise(2); GHPR681 from metsw24-max
ok dtucker
2026-06-29 17:45:18 +10:00
Damien Miller fa5416dec1 use size_t for lengths; GHPR681 from metsw24-max
ok dtucker
2026-06-29 17:45:14 +10:00
Damien Miller ef6bef31de fix leak of error path; GHPR681 from metsw24-max
ok dtucker
2026-06-29 17:45:04 +10:00
Damien Miller f5f02aafe8 another place mldsa-ed25519 keys need deactivation 2026-06-15 12:53:53 +10:00
Damien Miller ebdaacf490 bring back mlkem768x25519-sha256 stubs
should fix C89 compile
2026-06-15 11:44:49 +10:00
Damien Miller b35a6a153f don't build ML-KEM/ML-DSA code with <C99 compilers 2026-06-14 20:32:12 +10:00
Damien Miller 1c46384db9 include includes.h 2026-06-14 20:24:25 +10:00
Damien Miller ea505c83ec provide a htobe32() replacement 2026-06-14 18:56:31 +10:00
Damien Miller 8e0cb47177 hook up new regress/unittests/crypto 2026-06-14 15:02:24 +10:00
Damien Miller 47af21eb8d sync fmt_scaled.c with OpenBSD upstream
Notably picks up this commit:

revision 1.24
date: 2026/06/06 23:49:25;  author: djm;  state: Exp;  lines: +28 -12;  commitid: oznzDs0MaUT3FEqO;
rearrange scan_scaled(3) ordering of multiplications and divisions
to better preserve accuracy for large exponents. From metsw24-max
via https://github.com/openssh/openssh-portable/pull/671/

ok tb@
2026-06-07 09:56:41 +10:00
Damien Miller ea91c7a1a9 depend 2026-05-31 22:23:42 +10:00
Damien Miller 7ab700f170 Make failure to set SECCOMP or NO_NEW_PRIVS fatal
If your Linux system lacks support for these then please don't
enable the seccomp sandbox.

Prompted by manfred.kaiser@ssh-mitm.at
2026-05-30 23:30:13 +10:00
Damien Miller 67f31cefd8 update getrrsetbyname.c from OpenBSD upstream
revision 1.15
date: 2026/05/09 01:54:51;  author: tb;  state: Exp;  lines: +14 -13;  commitid: zZPVUWycKAslGJtO;
Avoid recursive cleanup in getrrsetbyname()

Instead of freeing struct dns_query and struct dns_rr by walking the
linked lists recursively, use a simple loop. This avoids a possible
stack exhaustion unlikely to be reachable with the limits modern
resolvers impose.

From Dhiraj Mishra
2026-05-12 14:36:27 +10:00
Damien Miller 328993c899 skip ("#if 0") strvisx and stravis
we don't use the in OpenSSH and some compilers throw warnings
compiling them that break -Werror
2026-05-04 16:05:34 +10:00
Damien Miller b433d015a6 regen signature on allowed_signers file
This was missed after the file was updated, but nobody noticed it
until now.
2026-04-15 08:14:58 +10:00
Damien Miller 4168c90594 depend 2026-04-02 18:56:48 +11:00
Damien Miller f8b9d694fc Update versions in RPM spec files 2026-04-02 18:55:50 +11:00
Damien Miller 5d72f1865b properly bail out when PAM changes username
OpenSSH doesn't support PAM changing its conception of the
username via a module calling pam_set_item(h, PAM_USER, ...).
We were supposed to bail out here, but I messed up while "fixing"
this last time and dropped a return statement.

Reported by Mike Damm
2026-04-02 18:32:00 +11:00
Damien Miller 54443b8665 depend 2026-03-29 16:43:59 +11:00
Damien Miller c90f46b623 use nonnull attribute when available
Set this attribute on a few string to avoid compiler warnings from
-Wunterminated-string-initialization warnings in recent gcc.
2026-03-29 16:42:33 +11:00
Damien Miller bdaf65ae51 fix state confusion between PAM and privsep code
Commits b9a6dd4d6 and df2b28163 introduced a potential desynchronisation
between the PAM code and the sshd-session monitor that could result in
authentication bypass if the unprivileged sshd-auth process had been
compromised.

Reported by Ben Edelman of NIST. Only git HEAD is affected, these
changes have not yet been included in an OpenSSH release.
2026-03-29 16:24:59 +11:00
Damien Miller 73888af650 stubs for OpenBSD unveil(2) 2026-03-10 14:43:30 +11:00
Damien Miller d128133144 octal-escape the colon character
Apparently these are YAML magic when followed by whitespace
2025-11-07 15:49:55 +11:00
Damien Miller 5a104d81a2 try single quotes instead of escaped quotes 2025-11-07 15:44:18 +11:00
Damien Miller 48d8293956 escape quotes in yaml 2025-11-07 15:42:57 +11:00
Damien Miller 2425d7faf4 check PAM user against previous user, not pw_name
Avoids early fatal() if the user doesn't exist.

Reported by Viswesh Narayanan; ok dtucker@
2025-10-31 13:47:49 +11:00
Damien Miller 7e2f89b0fb skip pkcs11 tests when built --without-openssl 2025-10-31 12:19:47 +11:00
Damien Miller 590a260f0b add sshlog() replacement to sk-dummy.so 2025-10-31 12:19:34 +11:00
Damien Miller 57e347bae0 rename openbsd-compat sha2.h -> bsd-sha2.h
avoids confusion with system header when included from files under
openbsd-compat/
2025-10-31 11:16:29 +11:00
Damien Miller a5f6385851 fix linking for sk-dummy.so, used in tests 2025-10-31 11:07:17 +11:00
Damien Miller afe83537e0 include tmux in CI package list 2025-10-21 09:14:35 +11:00
Damien Miller ce49aceba9 link ssh against ssh-pkcs11.o
Should fix PIN entry for direct use of PKCS11Provider in ssh(1)
bz3879
2025-10-16 11:15:16 +11:00
Damien Miller 3adc47e161 don't leak PAM handle on repeat invocations
Reported by Casper Dik via bz3882; ok dtucker@
2025-10-14 14:53:33 +11:00
Damien Miller da2f945f62 check whether diff accepts -N 2025-10-13 14:33:04 +11:00
Damien Miller b6fd0e6d08 depend 2025-10-10 15:23:59 +11:00
Damien Miller 081b8dbbe9 complete PKCS#11 stubs and move to ssh-pkcs11.c
Should unbreak --disable-pkcs11 builds
2025-10-09 13:12:15 +11:00
Damien Miller ac44577879 some fixes to p11_setup
1. Use the ssh-keygen under test and not the one in $PATH
2. Include a test PKCS#11 operation to ensure that the P11 stack is
   working correctly.

Previously, it was possible for p11_setup to return success on
configurations with PKCS#11 support disabled.
2025-10-09 13:10:27 +11:00
Damien Miller 3470f465c6 link ssh-keygen directly against ssh-pkcs11.c
Matches what OpenBSD does and fixes ssh-keygen regression in
certifying keys using a CA key hosted via ssh-agent (bz3877)
2025-10-09 10:07:40 +11:00
Damien Miller 476bab6259 depend 2025-10-06 12:52:25 +11:00
Damien Miller af956575eb update versions 2025-10-06 12:51:13 +11:00
Damien Miller 2fd0945913 sync ssh-copy-id to upstream version 527be673f4d 2025-10-06 12:48:16 +11:00
Damien Miller f38a552dc7 missing header 2025-09-03 09:42:39 +10:00
Damien Miller d94a9a8c54 portable-specific comment grammer/spelling fixes 2025-09-02 19:38:39 +10:00
Damien Miller 23a2bb7505 replace remaining manual logging of __func__
Use the appropriate log macro that prepends the function name
(e.g. logit_f/debug2_f/etc).
2025-09-02 19:30:07 +10:00
Damien Miller 3ef1a87d0a Fix pledge(2) special casing
Unbreaks non-OpenBSD platforms
2025-08-18 17:00:26 +10:00
Damien Miller 5e9ca80fe6 Match version instead of groups in connect-bigconf
The connect-bigconf makes a giant config file to test config passing
between the sshd subprocesses. Previously it used a bunch of "Match
group" lines to construct a large file. However checking group
membership can be expensive (e.g. if a large groups database is
present or if group lookup is remote via NSS). This could be slow
enough to exceed LoginGraceTime.

This switches it to "Match version" which is just a string compare
and does just as well for making a giant nonsense config file.
2025-08-18 16:47:23 +10:00
Damien Miller 6c84609e5f depend 2025-08-18 16:47:00 +10:00
Damien Miller 9184fa3636 check for setsockopt IP_TOS in OpenBSD pledge
OpenBSD has recently relaxed the pledge(2) sandbox to allow some
setsockopt options to be changed without the "inet" promise.

This adds compatibility for OpenBSD that predates this relaxation.
2025-08-18 16:45:15 +10:00
Damien Miller 056022261e depend 2025-08-18 14:22:32 +10:00
Damien Miller b7ee13fbbb wrap SIGINFO in ifdef 2025-08-18 14:22:18 +10:00