[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#873201: marked as done (openssh-client: command line parsing with -- between option and non-option arguments completely broken)



Your message dated Sun, 19 Nov 2017 22:47:45 +0000
with message-id <E1eGYNN-000Epv-P5@fasolo.debian.org>
and subject line Bug#873201: fixed in openssh 1:6.7p1-5+deb8u4
has caused the Debian Bug report #873201,
regarding openssh-client: command line parsing with -- between option and non-option arguments completely broken
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
873201: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=873201
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: openssh-client
Version: 1:7.5p1-7
Severity: grave
Tags: upstream security
Justification: user security hole

Dear Debian maintainer,

I was intending to report this upstream, but, contrary to the documentation
     * [9]openssh-unix-dev@mindrot.org This is a public list and is open to posting from non-subscribed
       users.
on https://www.openssh.com/report.html the upstream mailing list is not
open for postings, as I got a rejection message…
> Posting by non-members to openssh-unix-dev@mindrot.org is currently
> disabled, sorry.
… so please forward this upstream, as is a package maintainer’s duty.

Original message follows:

-----cutting here may damage your screen surface-----
From: Thorsten Glaser <t.glaser@tarent.de>
Message-ID: <alpine.DEB.2.20.1708251545580.2732@tglase.lan.tarent.de>
To: openssh-unix-dev@mindrot.org
Date: Fri, 25 Aug 2017 15:57:47 +0200 (CEST)
Subject: command line parsing with -- between option and non-option arguments completely broken

Hi,

in the process of me fixing CVE-2017-12836 a user noticed a
problem with OpenSSH’s command line parsing.

I’ve verified these on OpenSSH 5.3 (MirBSD) and 7.5p1 (Debian).

So, to begin with, this command _should_ spawn xeyes:

$ ssh -oProxyCommand=xeyes vuxu.org

This command _could_ spawn xeyes on glibc systems, but
probably shouldn’t on POSIX or BSD systems:

$ ssh vuxu.org -oProxyCommand=xeyes

This command properly does not spawn xeyes but tries to
resolve “-oProxyCommand=xeyes” as hostname, correctly failing:

$ ssh -- -oProxyCommand=xeyes

This command *must not* spawn xeyes, but does:

$ ssh -- vuxu.org -oProxyCommand=xeyes

This instead must execute “-oProxyCommand=xeyes” as command
on the remote side.

Interestingly enough, this command works the same and also
mustn’t but also doesn’t:

$ ssh vuxu.org -- -oProxyCommand=xeyes

Now it gets completely weird, this doesn’t spawn xeyes either:

$ ssh -- vuxu.org -- -oProxyCommand=xeyes

This “should” execute “--” as command with “-oProxyCommand=xeyes”
as its first option on the remote site, but judging from the error
| mksh: ProxyCommand=xeyes: unknown option
it instead passes “-oProxyCommand=xeyes” as option to a shell on
the remote side.

I don’t do the security theatre, but this could perhaps be considered
missing command escaping on the remote side (passing what would be a
command as an option to the remote shell) in addition to completely
fucked up option parsing on the local side.

This was first reported by nickserv-auth’d user jn__ on #musl on
Freenode IRC, and leah2 forwarded it to me as current de-facto
maintainer of GNU CVS because I considered adding “--” between
option and nōn-option arguments sufficient for fixing the afore‐
mentioned CVE, judging this effective enough with normal command
line parsing rules (as in getopt(3) on OpenBSD) and given the
.Sx SYNOPSIS
in the ssh manpage.

bye,
//mirabilos

PS: Please keep me in Cc, I’m not subscribed to the list.
-----cutting here may damage your screen surface-----

Thanks!

PS: This affects cvs in wheezy, jessie and stretch but not sid.


-- System Information:
Debian Release: buster/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: i386, amd64

Kernel: Linux 4.11.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)

Versions of packages openssh-client depends on:
ii  adduser           3.116
ii  dpkg              1.18.24
ii  libc6             2.24-14
ii  libedit2          3.1-20170329-1
ii  libgssapi-krb5-2  1.15.1-2
ii  libselinux1       2.6-3+b2
ii  libssl1.0.2       1.0.2l-2
ii  passwd            1:4.4-4.1
ii  zlib1g            1:1.2.8.dfsg-5

Versions of packages openssh-client recommends:
ii  xauth  1:1.0.9-1

Versions of packages openssh-client suggests:
pn  keychain                  <none>
ii  kwalletcli [ssh-askpass]  3.00-1
pn  libpam-ssh                <none>
pn  monkeysphere              <none>

-- Configuration Files:
/etc/ssh/moduli changed [not included]
/etc/ssh/ssh_config changed [not included]

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: openssh
Source-Version: 1:6.7p1-5+deb8u4

We believe that the bug you reported is fixed in the latest version of
openssh, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 873201@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Colin Watson <cjwatson@debian.org> (supplier of updated openssh package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sat, 18 Nov 2017 10:56:29 +0000
Source: openssh
Binary: openssh-client openssh-server openssh-sftp-server ssh ssh-krb5 ssh-askpass-gnome openssh-client-udeb openssh-server-udeb
Architecture: source amd64 all
Version: 1:6.7p1-5+deb8u4
Distribution: jessie
Urgency: medium
Maintainer: Debian OpenSSH Maintainers <debian-ssh@lists.debian.org>
Changed-By: Colin Watson <cjwatson@debian.org>
Description:
 openssh-client - secure shell (SSH) client, for secure access to remote machines
 openssh-client-udeb - secure shell client for the Debian installer (udeb)
 openssh-server - secure shell (SSH) server, for secure access from remote machines
 openssh-server-udeb - secure shell server for the Debian installer (udeb)
 openssh-sftp-server - secure shell (SSH) sftp server module, for SFTP access from remot
 ssh        - secure shell client and server (metapackage)
 ssh-askpass-gnome - interactive X program to prompt users for a passphrase for ssh-ad
 ssh-krb5   - secure shell client and server (transitional package)
Closes: 865770 873201
Changes:
 openssh (1:6.7p1-5+deb8u4) jessie; urgency=medium
 .
   * Test configuration before starting or reloading sshd under systemd
     (closes: #865770).
   * Make "--" before the hostname terminate argument processing after the
     hostname too (closes: #873201).
Checksums-Sha1:
 d0d499b91f65e4782c4664023ddfb135e1b2e028 2723 openssh_6.7p1-5+deb8u4.dsc
 70b6eafed91f78009d04d5b5390579d79fdaa998 151584 openssh_6.7p1-5+deb8u4.debian.tar.xz
 1d77925fa662f5d25eac37055b439fa65540eae5 692514 openssh-client_6.7p1-5+deb8u4_amd64.deb
 23a4092e567f89af42ba1e9aaebae4f1d410b947 331344 openssh-server_6.7p1-5+deb8u4_amd64.deb
 f26905cd1d45df17bd1b88d7ff74339a5c2b9cab 37914 openssh-sftp-server_6.7p1-5+deb8u4_amd64.deb
 6064c857d7b9a35bb3dc65e47147a1a754520891 119974 ssh_6.7p1-5+deb8u4_all.deb
 d5be9faefeee34c3bfeae838578c23e4de207c8f 119506 ssh-krb5_6.7p1-5+deb8u4_all.deb
 bc122485f886b3da155b5aeace7a44453c3e0eea 127604 ssh-askpass-gnome_6.7p1-5+deb8u4_amd64.deb
 e1044dffcfc934ea4654e197b51283d659ac1e61 258754 openssh-client-udeb_6.7p1-5+deb8u4_amd64.udeb
 2a31820af9544a419fba6ead213f6ce23ea40654 284912 openssh-server-udeb_6.7p1-5+deb8u4_amd64.udeb
Checksums-Sha256:
 4b71d7eb2291c096173e701113a3c56cbcc23e9a13d3ddec539518fa4a25dd8d 2723 openssh_6.7p1-5+deb8u4.dsc
 2523942c9a8472331a47ce8b34c9433fbea381bae8940821e3b378767a3c33f9 151584 openssh_6.7p1-5+deb8u4.debian.tar.xz
 c45c56351f304858c08d4c3ffa9f816f3f1731248b555ece2a40c52c57d6f4fb 692514 openssh-client_6.7p1-5+deb8u4_amd64.deb
 abf7c445c5ec4e58ea2e6528dd62dcefbae4cc609075dcf2c34e3e5e304536ff 331344 openssh-server_6.7p1-5+deb8u4_amd64.deb
 69fe2b1c5e2867d66d4ed95b45e93528c95c9e7481b6bb5c609ae83a397bfed3 37914 openssh-sftp-server_6.7p1-5+deb8u4_amd64.deb
 6fcd4decb6fc4a4dd8f819d395d60444d2c0a29324d6865621671c2942247a4e 119974 ssh_6.7p1-5+deb8u4_all.deb
 68760de7bd8d15fc4f77833a1ac3cc21984c29764deb3551f1fdced2596402d4 119506 ssh-krb5_6.7p1-5+deb8u4_all.deb
 cbdd81a680efe87a44e0c62326f3ec8c33fb720544d25e31acff5c44a6736fb3 127604 ssh-askpass-gnome_6.7p1-5+deb8u4_amd64.deb
 3c4eb402b84c66ecf95aa27695f671292e645d37964a5a75bdb039853437efcd 258754 openssh-client-udeb_6.7p1-5+deb8u4_amd64.udeb
 1d512782abafd68adcc8cd4b185adecc03b0fec81c870c357ebd116c408b0228 284912 openssh-server-udeb_6.7p1-5+deb8u4_amd64.udeb
Files:
 9343c85cdcd21d6124575cdf8b0c0937 2723 net standard openssh_6.7p1-5+deb8u4.dsc
 c94a4f2cf4698223bbaafb5525a898c1 151584 net standard openssh_6.7p1-5+deb8u4.debian.tar.xz
 14e5e89655c03ed51a690aa2151f4f57 692514 net standard openssh-client_6.7p1-5+deb8u4_amd64.deb
 5c9fc8c2f002582c59a2588e41d3b528 331344 net optional openssh-server_6.7p1-5+deb8u4_amd64.deb
 642eef8901b30dae57181940d73ea05b 37914 net optional openssh-sftp-server_6.7p1-5+deb8u4_amd64.deb
 58fa7b34c67104dd7d63745d97c03b25 119974 net extra ssh_6.7p1-5+deb8u4_all.deb
 62906c0f0f282ea7e6f87e13a42660c3 119506 oldlibs extra ssh-krb5_6.7p1-5+deb8u4_all.deb
 c5280fcec263d444bda7db44d6c3f173 127604 gnome optional ssh-askpass-gnome_6.7p1-5+deb8u4_amd64.deb
 ca805ef17e6caa689a220f4f38f6c703 258754 debian-installer optional openssh-client-udeb_6.7p1-5+deb8u4_amd64.udeb
 6521d6d9e623a91de192e48227fcc9e1 284912 debian-installer optional openssh-server-udeb_6.7p1-5+deb8u4_amd64.udeb

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEErApP8SYRtvzPAcEROTWH2X2GUAsFAloRabIACgkQOTWH2X2G
UAtkJxAAoC6wo/fSuOhwyPwYOiv008BbW5O8YjwEaWZLNbKKE8PpTFvca3XaCGYw
Nt/f5qKFPy+PBm1oj77kGVoIi0rnvruetGr25v7FdiU8EDaZIEnmdBYHpL9YSpR3
fRDULIJMrqhlGLNyMlTPp33LyghsClDJNSebej3EBPSc3RdVBTTdlfGeYrUOmeFL
LbW0P3VhCHxURSbKkcf37xPSl4u4b1IfqjdlTeO4cpOO+KP+pQMBte79NYnQ4ktD
tyscVF8yHPBxxxKMdMZRaBuKkJkD9OwixfRNbzM058IXPr29EvQOia1pIUpRsX5m
uI9XuaWvLfuqY6olnRuS80vD9F8V003bvKvHRxVTwddWxW1IoGRcx4aspYt5jX4w
B8ixe3/oGrnXvgIEFEZUcVg4q0N3Zuj+p8NM7Dg1bYq07QjGjuxrI8mQJshWBmAw
BiwxmY+QpgqbNpmOIbYpiVM6XOml13cpHVHl38gItmJg3nOE+9Jvjr9BCjFfvvcf
OXXfDd//afClG3wCXB9nxin8lznx9Eofn4KTkUGM6ccQXJ8Ab+hpJIcOQgGIVreb
tJ/nfNh/T6CDjWa+NA+5fD4mHVMn3fhVr6N9BcAjDVUr9g+TQxCqz/8oi43q4RpQ
phCGG1gPZIdDImixnZ8YVE9IQlh94r8pPe6q8tMr4vmuQPmJ3V0=
=JNmc
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: