13437 Commits

Author SHA1 Message Date
djm@openbsd.org
a6f8f793d4 upstream: rewrite SOCKS4/4A/5 parsing code to use sshbuf functions
instead of manual pointer fiddling. Should make the code safer and easier to
read. feedback/ok markus@

OpenBSD-Commit-ID: 5ebd841fbd78d8395774f002a19c1ddcf91ad047
2026-01-04 20:57:00 +11:00
djm@openbsd.org
ea367b4bbc upstream: test the right thing, doofus
OpenBSD-Commit-ID: 31b2ec6e0b3dbd08c60ba2d969dd687cd80c25fd
2025-12-30 15:29:06 +11:00
djm@openbsd.org
5f2bc9cb86 upstream: avoid possible NULL deref if
ssh_packet_check_rekey_blocklimit() called before the encrypted transport is
brought up.

OpenBSD-Commit-ID: fb998ccbe59865e33a8ab6a6577f254d39bdc72f
2025-12-30 15:24:23 +11:00
djm@openbsd.org
b9c318777e upstream: unit tests for sshbuf_consume_upto_child()
OpenBSD-Regress-ID: 13cbd0370ebca7c61c35346b3e0356517719a447
2025-12-30 11:37:45 +11:00
djm@openbsd.org
dd49a87bf4 upstream: Remove bug compatibility for implementations that don't
support rekeying. AFAIK this is only an ancient Sun SSH version.

If such an implementation tries to interoperate with OpenSSH, it
will eventually fail when the transport needs rekeying.

This is probably long enough to use it to download a modern SSH
implementation that lacks this problem :)

ok markus@ deraadt@

OpenBSD-Commit-ID: 228a502fee808cf8b7caee23169eb6a1ab1c331a
2025-12-30 11:37:13 +11:00
djm@openbsd.org
ca313fef2d upstream: Enforce maximum packet/block limit during
pre-authentication phase

OpenSSH doesn't support rekeying before authentication completes to
minimise pre-auth attack surface.

Given LoginGraceTime, MaxAuthTries and strict KEX, it would be
difficult to send enough data or packets before authentication
completes to reach a point where rekeying is required, but we'd
prefer it to be completely impossible.

So this applies the default volume/packet rekeying limits to the
pre-auth phase. If these limits are exceeded the connection will
simply be closed.

ok dtucker markus

OpenBSD-Commit-ID: 70415098db739058006e4ebd1630b6bae8cc8bf6
2025-12-30 11:36:51 +11:00
djm@openbsd.org
55b6b16974 upstream: Add sshbuf_consume_upto_child(), to similify particular
parsing patterns using parent/child buffer; ok markus@

OpenBSD-Commit-ID: c11ed27907751f2a16c1283313e77f88617e4852
2025-12-30 11:36:51 +11:00
Ludovic Rousseau
6eafc52a41 Update ssh-agent.1
Add a missing "/" in the default allowed providers list.
2025-12-28 14:54:38 +11:00
djm@openbsd.org
09daf2ac5f upstream: correctly quote wildcard host certificate principal name,
lest it expand to an unrelated filename in the working directory

OpenBSD-Regress-ID: 8a9eb716d3ea7986d26c1a931758b996aa93c58e
2025-12-22 14:37:11 +11:00
djm@openbsd.org
dfd710e4e2 upstream: return 0 in void function; spotted by clang -Wextra
OpenBSD-Commit-ID: fe7461c93dfaef98a007a246af837a8275a1e539
2025-12-22 14:12:33 +11:00
djm@openbsd.org
ecdf9b9f8e upstream: regression tests for certificates with empty principals
sections (which are now unconditionally refused) and for certificates with
wildcard principals (which should only be accepted in host certs)

OpenBSD-Regress-ID: fdca88845a68424060547b4f9f32f90a7cf82e73
2025-12-22 12:51:33 +11:00
djm@openbsd.org
adca2f4398 upstream: don't try to test webauthn signatures. Nothing in OpenSSH
generates these (yet)

OpenBSD-Regress-ID: 48d59b7c4768c2a22ce3d8cf3b455e6ada9fc7b0
2025-12-22 12:51:32 +11:00
djm@openbsd.org
5166b6cbf2 upstream: When certificate support was added to OpenSSH,
certificates were originally specified to represent any principal if the
principals list was empty.

This was, in retrospect, a mistake as it created a fail-open
situation if a CA could be convinced to accidentally sign a
certificate with no principals. This actually happened in a 3rd-
party CA product (CVE-2024-7594).

Somewhat fortunately, the main pathway for using certificates in
sshd (TrustedUserCAKeys) never supported empty-principals
certificates, so the blast radius of such mistakes was
substantially reduced.

This change removes this footcannon and requires all certificates
include principals sections. It also fixes interpretation of
wildcard principals, and properly enables them for host
certificates only.

This is a behaviour change that will permanently break uses of
certificates with empty principals sections.

ok markus@

OpenBSD-Commit-ID: 0a901f03c567c100724a492cf91e02939904712e
2025-12-22 12:51:24 +11:00
djm@openbsd.org
aaac8c61c1 upstream: Don't misuse the sftp limits extension's open-handles
field. This value is supposed to be the number of handles a server will allow
to be opened and not a number of outstanding read/write requests that can be
sent during an upload/download.

ok markus@

OpenBSD-Commit-ID: 14ebb6690acbd488e748ce8ce3302bd7e1e8a5b0
2025-12-22 12:51:23 +11:00
djm@openbsd.org
daf6bdd34b upstream: add a "ssh -O channels user@host" multiplexing command to
get a running mux process to show information about what channels are
currently open; ok dtucker@ markus@

OpenBSD-Commit-ID: 80bb3953b306a50839f9a4bc5679faebc32e5bb8
2025-12-22 12:51:22 +11:00
djm@openbsd.org
b652322cdc upstream: typo in comment
OpenBSD-Commit-ID: f72306b86953e74f358096db141b4f9c00d33ed7
2025-12-19 12:29:46 +11:00
djm@openbsd.org
0b98be75db upstream: correctly check subsystem command is not the empty string
(was repeatedly checking the subsystem name) spotted by Coverity (CID 898836)

OpenBSD-Commit-ID: dabea2b499de8280f76f7291dd52086df6831cb0
2025-12-19 12:29:45 +11:00
djm@openbsd.org
345892ba2e upstream: regression test for bz3906: sshd crashing at connection
time if the config lacks a subsystem directive but one is defined in a match
block.

OpenBSD-Regress-ID: 5290553665307ccddaec2499ec1eb196bb2efc84
2025-12-19 11:59:52 +11:00
djm@openbsd.org
81e5bb8d93 upstream: check that invalid subsystem directives inside Match
blocks are noticed at startup; bz#3906

OpenBSD-Regress-ID: b9171bde4cc24757a826b3da0e9eadc33995a453
2025-12-19 11:59:52 +11:00
djm@openbsd.org
831e6db69f upstream: don't crash at connection time if the main sshd_config
lacks any subsystem directive but one is defined in a Match block

bz#3906; ok dtucker

OpenBSD-Commit-ID: 2eb9024726d6f10eaa41958faeca9c9ba5ca7d8a
2025-12-19 11:59:42 +11:00
djm@openbsd.org
4e0f2dee54 upstream: detect invalid sshd_config Subsystem directives inside
Match blocks at startup rather than failing later at runtime;

noticed via bz#3906; ok dtucker

OpenBSD-Commit-ID: e6035ff0baa375de6c9f22c883ed530a8649dfed
2025-12-19 11:58:36 +11:00
jsg@openbsd.org
4c9de155ce upstream: new sentence, new line
OpenBSD-Commit-ID: 23974d7c98b2ba4fea7f5143676c34e04ffd4128
2025-12-19 11:58:35 +11:00
jsg@openbsd.org
3ab346aa6d upstream: fix markup, .CM -> .Cm
OpenBSD-Commit-ID: 4db8cb254792df8a4dce11825852e089ae3d053a
2025-12-19 11:58:34 +11:00
dtucker@openbsd.org
f878d7ccc2 upstream: Plug leak in ssh_digest_memory on error path.
Bonehead mistake spotted by otto@, ok djm@

OpenBSD-Commit-ID: 4ad67ac402e0b4c013f4f4e386d22b88969a5dd7
2025-12-16 20:41:22 +11:00
dtucker@openbsd.org
49480f1934 upstream: Add 'invaliduser' penalty to PerSourcePenalties, which is
applied to login attempts for usernames that do not match real accounts.
Defaults to 5s to match 'authfail' but allows administrators to block such
sources for longer if desired.  with & ok djm@

OpenBSD-Commit-ID: bb62797bcf2adceb96f608ce86d0bb042aff5834
2025-12-16 20:40:59 +11:00
djm@openbsd.org
94bf1154b4 upstream: add a GssDelegateCreds option for the server, controlling
whether it accepts delgated credentials offered by the client. This option
mirrors GssDelegateCreds in ssh_config.

From Dmitry Belyavskiy via GHPR614; ok dtucker@

OpenBSD-Commit-ID: ac419354edb26cef9ad15692e0bed17a03997786
2025-12-08 14:57:11 +11:00
djm@openbsd.org
24f32f7755 upstream: errant line
OpenBSD-Commit-ID: 8542d59f5ba48a67c3ebd5de17f9fa408ec54ca5
2025-12-08 11:45:31 +11:00
djm@openbsd.org
a1e37f0998 upstream: There is a warning next to the authorized_keys command=""
flag that forcing a command doesn't automatically disable forwarding. Add one
next to the sshd_config(5) ForceCommand directive too.

feedback deraadt@

OpenBSD-Commit-ID: bfe38b4d3cfbadbb8bafe38bc256f5a17a0ee75c
2025-12-08 11:45:31 +11:00
djm@openbsd.org
70ad2e9a2b upstream: increment correct variable when counting group
memberships. Reported by Kevin Day via bz3903

OpenBSD-Commit-ID: 772b9aafd5165a7c407f08cb95f8b94cc5a4c1c0
2025-12-08 11:45:30 +11:00
Darren Tucker
d05b704086 Add OpenBSD 7.8 VM test target. 2025-12-07 20:45:54 +11:00
Darren Tucker
f086fafa04 Remove generated compat includes during distclean. 2025-12-07 20:45:54 +11:00
Darren Tucker
185459dd87 Define IPTOS_DSCP_VA if not already defined. 2025-12-07 14:17:20 +11:00
phessler@openbsd.org
f701869185 upstream: allow network programs select DSCP_VA for network ToS
OK stsp@

OpenBSD-Commit-ID: 8019fd6e8c522b4b5f291a2c0e3bf2437cc70dc1
2025-12-07 14:14:33 +11:00
dtucker@openbsd.org
f62868e03e upstream: Avoid "if ! thing || ! otherthing; then" constructs since
they seem to cause portability problems.

OpenBSD-Regress-ID: ff001be683de43bf396cd5f9f6a54e0c7a99c3cf
2025-12-07 14:01:59 +11:00
dtucker@openbsd.org
45aca67d79 upstream: spaces->tab
OpenBSD-Regress-ID: c78eb430da0ec2c4b6919ff4d27ef8e565ef52ff
2025-12-07 14:00:47 +11:00
dtucker@openbsd.org
ab164f6716 upstream: Append a newline, otherwise some sed's won't output anything.
OpenBSD-Regress-ID: 507cb8c36bb7fc338f60a55bf7040f479536b3f7
2025-12-06 18:47:19 +11:00
dtucker@openbsd.org
c99a30d30a upstream: Don't check compressions stats when ssh does not support
compression.

OpenBSD-Regress-ID: 026db51b2654a949e9a10b908443dab83b64c74a
2025-12-06 14:45:46 +11:00
djm@openbsd.org
5f5d1af478 upstream: ASSERT_DOUBLE_* test helpers
OpenBSD-Regress-ID: cdb5c4e95c0f00efb773ddba4056a49e33702cf9
2025-12-05 22:14:04 +11:00
Darren Tucker
70a01a7e66 Set SSH_REGRESS_TMP after making tmpdir.
Put both of these later in the script so the cvsids don't cause
conflicts on every synced patch.
2025-12-05 20:02:39 +11:00
dtucker@openbsd.org
89a67a04e5 upstream: Shell compatibility fix.
OpenBSD-Regress-ID: bceaeb267d49c13e4a797c42e93b8f0cdb14dbd7
2025-12-05 19:33:18 +11:00
djm@openbsd.org
f4e79a4ba9 upstream: unit tests for convtime_double()
OpenBSD-Regress-ID: d3ba7b894019b4128845d638c78fca37b3b6eecf
2025-12-05 19:19:43 +11:00
djm@openbsd.org
c48de35bea upstream: convert PerSourcePenalties to using floating point time,
allowing penalties to be less than a second. This is useful if you need to
penalise things you expect to occur at >=1 QPS.

feedback dtucker / deraadt; ok deraadt@

OpenBSD-Commit-ID: 89198be755722131b45a52d22d548e4c602201f0
2025-12-05 19:19:34 +11:00
djm@openbsd.org
f45cd249e4 upstream: Add convtime_double() that converts a string interval,
such as "3w2d4h5m10.5s", into a floating point number of seconds.

Reimplement the existing convtime() function using convtime_double()
(it just drops the fractional seconds)

lots of feedback deraadt@ / dtucker@; ok deraadt@

OpenBSD-Commit-ID: 053cdd0c72325a20efc6613caa847473fb89e36f
2025-12-05 19:19:28 +11:00
dtucker@openbsd.org
b7dc1d95ee upstream: Add test for ssh -Oconninfo mux command.
OpenBSD-Regress-ID: e939edc41caad8b6ad00ff294f33b61ed32a1edd
2025-12-05 18:05:57 +11:00
dtucker@openbsd.org
eb97fc2b5e upstream: Add an ssh -Oconninfo command
that shows connection information, similar to the ~I escapechar.
This is the first use of the mux extension mechanism, so it should be
both forward and backward compatible: a new client talking to an old
server will not allow the "conninfo" request to be sent, but everything
else should work seamlessly.  feedback and ok djm@

OpenBSD-Commit-ID: 50f047a85da277360558cabdfed59cb66f754341
2025-12-05 18:05:44 +11:00
djm@openbsd.org
66622394fd upstream: correctly quote filenames in verbose output for local->local
copies; from Colin Watson via bz3900; ok dtucker@

OpenBSD-Commit-ID: 5c09b030e2024651ebc8c1f9af6a8a2d37912150
2025-12-03 17:30:40 +11:00
dtucker@openbsd.org
8fce5520a1 upstream: Add local hostname and pid to ~I escape connection info,
only display peer information for TCP connections including source address
and port This provides enough information to uniquely identify a connection
on the host or network.

OpenBSD-Commit-ID: aa18a4af2de41c298d1195d2566808585f8ce964
2025-11-29 19:00:57 +11:00
dtucker@openbsd.org
2e8b5de4a7 upstream: Add compression stats to ~I connection info escape
option.

OpenBSD-Commit-ID: 83424b71fc226ea6b3dc8dda39f993475fdbd775
2025-11-29 19:00:56 +11:00
dtucker@openbsd.org
52037ed910 upstream: Add Escape option ~I that shows information about the current
SSH connection. ok djm@, "I like/want" sthen@ florian@

OpenBSD-Commit-ID: 0483fc0188ec899077e4bc8e1e353f7dfa9f5c1d
2025-11-27 19:48:04 +11:00
djm@openbsd.org
0fb1f3c995 upstream: move mention of default MaxStartups (which uses the
form.

GHPR568 from Santiago Vila

OpenBSD-Commit-ID: 7e68771f3cad61ec67303607afb3b85639288b29
2025-11-25 12:15:02 +11:00