diff options
author | 2008-06-10 22:15:23 +0000 | |
---|---|---|
committer | 2008-06-10 22:15:23 +0000 | |
commit | 82046f860a14070adce860bc20dcba3584eb4a86 (patch) | |
tree | 313fb54aa9cee2dbe0661ae3f738582124b3c513 /usr.bin/ssh/ssh.c | |
parent | Arguments to fifo commands were limited to 80 bytes. That is too (diff) | |
download | wireguard-openbsd-82046f860a14070adce860bc20dcba3584eb4a86.tar.xz wireguard-openbsd-82046f860a14070adce860bc20dcba3584eb4a86.zip |
Add a no-more-sessions@openssh.com global request extension that the
client sends when it knows that it will never request another session
(i.e. when session multiplexing is disabled). This allows a server to
disallow further session requests and terminate the session.
Why would a non-multiplexing client ever issue additional session
requests? It could have been attacked with something like SSH'jack:
http://www.storm.net.nz/projects/7
feedback & ok markus
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r-- | usr.bin/ssh/ssh.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 08cb7c61686..644adc4c1ce 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.313 2008/05/09 14:26:08 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.314 2008/06/10 22:15:23 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -1132,6 +1132,15 @@ ssh_session2(void) if (!no_shell_flag || (datafellows & SSH_BUG_DUMMYCHAN)) id = ssh_session2_open(); + /* If we don't expect to open a new session, then disallow it */ + if (options.control_master == SSHCTL_MASTER_NO) { + debug("Requesting no-more-sessions@openssh.com"); + packet_start(SSH2_MSG_GLOBAL_REQUEST); + packet_put_cstring("no-more-sessions@openssh.com"); + packet_put_char(0); + packet_send(); + } + /* Execute a local command */ if (options.local_command != NULL && options.permit_local_command) |