Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute Command doesnt work with dropbear #128

Closed
legraps opened this issue Dec 15, 2014 · 13 comments
Closed

Execute Command doesnt work with dropbear #128

legraps opened this issue Dec 15, 2014 · 13 comments

Comments

@legraps
Copy link

legraps commented Dec 15, 2014

Environment:
SSHLibrary version: 2.1.1
Paramiko version: 1.15.1
Used interpreter: Python 2.7.6
Operating system: Ubuntu 14.04.1 LTS

Since upgrading dropbear in my embedded target (to 2014.66) Executing Command or rather waiting for the Command Result leads to hanging in an endless loop in read_outputs in paramikos recv_exit_status() function. It seems that upon receiving dropbears EOF we never send a EOF which leads to the connection still being open. SSHLibraries _shell_open() function however makes us think the connection was teared down correctly.

I have tracked down the issue in dropbear to their changeset:

936:d93a6bcf616f
Improve handling lots of concurrent forwarded connections. Increase connection backlog, avoid check_close() for channels that haven't had IO

but I cant actually change that code in our target. (all other ssh connections do work without problems).

So below is a patch that fixes my problem by checking if exit_status_ready() will be successful before actually exexuting recv_exit_status(). In case it's not, the write direction is closed forcefully (which sends out the missing? EOF).

It works for me but I'm not sure if this is ok for everybody...? Any experts on this?

Index: SSHLibrary/src/SSHLibrary/pythonclient.py

--- SSHLibrary.orig/src/SSHLibrary/pythonclient.py 2014-12-15 11:38:59.830379909 +0100
+++ SSHLibrary/src/SSHLibrary/pythonclient.py 2014-12-15 11:40:13.132928618 +0100
@@ -169,6 +169,8 @@

 def read_outputs(self):
     stderr, stdout = self._receive_stdout_and_stderr()
  •    if not self._shell.exit_status_ready():
    
  •        self._shell.shutdown_write()
     rc = self._shell.recv_exit_status()
     self._shell.close()
     return stdout, stderr, rc
    
@pekkaklarck
Copy link
Contributor

  1. The included patch is broken because GitHub parses is as Markdown. You should put it into a fenced code block.

  2. I'm not an expert regarding to this subject but the fix looks good.

  3. Have you tested does the same problem occur also if you run tests using Jython? If it does, could you investigate is there similar fix for it?

@legraps
Copy link
Author

legraps commented Dec 16, 2014

Hi,
3) Havnt tested Jython. I see if I get around it today.
2) As to maturity: I've seen seemingly similar hangup during a large sftp transfer. Needs investigating..

  1. below is the patch in clean form again
Index: SSHLibrary/src/SSHLibrary/pythonclient.py
===================================================================
--- SSHLibrary.orig/src/SSHLibrary/pythonclient.py  2014-12-15 11:38:59.830379909 +0100
+++ SSHLibrary/src/SSHLibrary/pythonclient.py   2014-12-15 11:40:13.132928618 +0100
@@ -169,6 +169,8 @@

     def read_outputs(self):
         stderr, stdout = self._receive_stdout_and_stderr()
+        if not self._shell.exit_status_ready():
+            self._shell.shutdown_write()
         rc = self._shell.recv_exit_status()
         self._shell.close()
         return stdout, stderr, rc

@legraps
Copy link
Author

legraps commented Dec 16, 2014

Unfortunately at the moment I dont find time to make my tests run with jython. The code looks different though so this might not be a problem.
The sftp issue might be rooted in the sftp-server I use, so it's not part of this issue.

@causten
Copy link

causten commented Nov 4, 2015

#1 thanks for the fix. It works for my embedded project using dropbear too
#2 any chance this is going in soon?

@jomofer
Copy link

jomofer commented Nov 4, 2015

Hi

Once again, thanks for this fix. Updating dropbear to v2015.68 on an embedded project seems to require this hotfix in SSHLibrary.

Tested with pybot

@legraps
Copy link
Author

legraps commented Nov 4, 2015

Actually I reverted the patch in my setup because unfortunately it doesnt fix the issue 100%. Finally I was able to change dropbear in our target, so I reverted the commit I indicated in my initial post.

@causten
Copy link

causten commented Nov 4, 2015

so you fixed it in dropbear? Any chance you upstreamed it or have a patch?

@jomofer
Copy link

jomofer commented Nov 5, 2015

Yes, I have seen some problems regarding SSH after more tries, too.
At the end, I have changed dropbear to v2014.63 and SSHLibrary to 2.1.1 without any patches

causten referenced this issue in mkj/dropbear Nov 6, 2015
connection backlog, avoid check_close() for channels that haven't had IO
causten pushed a commit to causten/openbmc-barreleye that referenced this issue Nov 6, 2015
Dropbear last year added a change that breaks the SSHLibrary for
robot test framework.

Details about the problem...
MarketSquare/SSHLibrary#128

The actual commit that caused the problem
mkj/dropbear@ca86726
@mkj
Copy link

mkj commented Nov 20, 2015

I'll look at this from the Dropbear side, is there a simple testcase I can run with SSHLibrary? Thanks

@legraps
Copy link
Author

legraps commented Nov 20, 2015

Hi mkj, thanks for looking into it. Here's a quick setup:
pip install robotframework
pip install robotframework-SSHLibrary

Create a file dropbear.txt:

*** Settings ***
Library           SSHLibrary

*** Test Cases ***
Repeatedly issue commands via dropbear ssh
    Enable Ssh Logging    ssh.log
    Open Connection    ${IP}
    Login    root    dropbear
    : FOR    ${i}    IN RANGE    100
    \    SSHLibrary.Execute Command    echo dropbear ${i}

Run it with (replace localhost with whatever your host is)
pybot -L TRACE -v IP:localhost dropbear.txt

It'll hang after a few repetitions. If you end the test by killing the active dropbear thread on the other side you'll get a nice log.html, but it wont give you too much information. Maybe the ssh.log helps.

Am curious what you find...

@mkj
Copy link

mkj commented Nov 27, 2015

I think this should be fixed in mkj/dropbear@ee35384 Fix ses.channel_signal_pending race

There was a signal handler race so Dropbear would sometimes miss noticing the child process exiting.

@jussimalinen
Copy link
Contributor

Alright, thanks @mkj! If I understood correctly, this means that we can close this issue on our side. We can reopen this if some action is required on our side.

@legraps
Copy link
Author

legraps commented Nov 28, 2015

Tested the latest dropbear issuing 5000 commands via SSHLibrary and dont see the problem any longer (on x86). Thanks mkj!
For now I dont think there's anything else required on SSHLibrary side.

philb pushed a commit to openembedded/openembedded-core that referenced this issue Dec 12, 2015
2015.71 - 3 December 2015

- Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

- Fix crash on exit when -p address:port is used, broke in 2015.68

- Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from Konstantin Tokarev

- Fix bad configure script test which didn't work with dash shell, patch from Juergen Daubert,
  broke in 2015.70

- Fix server race condition that could cause sessions to hang on exit,
  MarketSquare/SSHLibrary#128

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
causten pushed a commit to causten/openbmc-barreleye that referenced this issue Jan 12, 2016
The issue I asked to be fixed is in the new version of dropbear.
The problem was causing robot test code from running remote
commands like ipmitool.  I had to work around the issue building
my own private 'requests' robot code.  Now that it is fixed
you do not need any special code for Robot test automation
Additional details can be found here...
MarketSquare/SSHLibrary#128
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue May 17, 2017
2016.74 - 21 July 2016

- Security: Message printout was vulnerable to format string injection.

  If specific usernames including "%" symbols can be created on a system
  (validated by getpwnam()) then an attacker could run arbitrary code as root
  when connecting to Dropbear server.

  A dbclient user who can control username or host arguments could potentially
  run arbitrary code as the dbclient user. This could be a problem if scripts
  or webpages pass untrusted input to the dbclient program.
  CVE-2016-7406
  https://secure.ucc.asn.au/hg/dropbear/rev/b66a483f3dcb

- Security: dropbearconvert import of OpenSSH keys could run arbitrary code as
  the local dropbearconvert user when parsing malicious key files
  CVE-2016-7407
  https://secure.ucc.asn.au/hg/dropbear/rev/34e6127ef02e

- Security: dbclient could run arbitrary code as the local dbclient user if
  particular -m or -c arguments are provided. This could be an issue where
  dbclient is used in scripts.
  CVE-2016-7408
  https://secure.ucc.asn.au/hg/dropbear/rev/eed9376a4ad6

- Security: dbclient or dropbear server could expose process memory to the
  running user if compiled with DEBUG_TRACE and running with -v
  CVE-2016-7409
  https://secure.ucc.asn.au/hg/dropbear/rev/6a14b1f6dc04

  The security issues were reported by an anonymous researcher working with
  Beyond Security's SecuriTeam Secure Disclosure www.beyondsecurity.com/ssd.html

- Fix port forwarding failure when connecting to domains that have both
  IPv4 and IPv6 addresses. The bug was introduced in 2015.68

- Fix 100% CPU use while waiting for rekey to complete. Thanks to Zhang Hui P
  for the patch


2016.73 - 18 March 2016

- Support syslog in dbclient, option -o usesyslog=yes. Patch from Konstantin Tokarev

- Kill a proxycommand when dbclient exits, patch from Konstantin Tokarev

- Option to exit when a TCP forward fails, patch from Konstantin Tokarev

- New "-o" option parsing from Konstantin Tokarev. This allows handling some extra options
  in the style of OpenSSH, though implementing all OpenSSH options is not planned.

- Fix crash when fallback initshells() is used, reported by Michael Nowak and Mike Tzou

- Allow specifying commands eg "dropbearmulti dbclient ..." instead of symlinks

- Various cleanups for issues found by a lint tool, patch from Francois Perrad

- Fix tab indent consistency, patch from Francois Perrad

- Fix issues found by cppcheck, reported by Mike Tzou

- Use system memset_s() or explicit_bzero() if available to clear memory. Also make
  libtomcrypt/libtommath routines use that (or Dropbear's own m_burn()).

- Prevent scp failing when the local user doesn't exist. Based on patch from Michael Witten.

- Improved Travis CI test running, thanks to Mike Tzou

- Improve some code that was flagged by Coverity and Fortify Static Code Analyzer

2016.72 - 9 March 2016

- Validate X11 forwarding input. Could allow bypass of authorized_keys command= restrictions,
  found by github.com/tintinweb. Thanks for Damien Miller for a patch. CVE-2016-3116
  https://secure.ucc.asn.au/hg/dropbear/rev/a3e8389e01ff

2015.71 - 3 December 2015

- Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

- Fix crash on exit when -p address:port is used, broke in 2015.68, thanks to
  Frank Stollenwerk for reporting and investigation

- Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from Konstantin Tokarev

- Fix bad configure script test which didn't work with dash shell, patch from Juergen Daubert,
  broke in 2015.70

- Fix server race condition that could cause sessions to hang on exit,
  MarketSquare/SSHLibrary#128

2015.70 - 26 November 2015

- Fix server password authentication on Linux, broke in 2015.69

2015.69 - 25 November 2015

- Fix crash when forwarded TCP connections fail to connect (bug introduced in 2015.68)

- Avoid hang on session close when multiple sessions are started, affects Qt Creator
  Patch from Andrzej Szombierski

- Reduce per-channel memory consumption in common case, increase default
  channel limit from 100 to 1000 which should improve SOCKS forwarding for modern
  webpages

- Handle multiple command line arguments in a single flag, thanks to Guilhem Moulin

- Manpage improvements from Guilhem Moulin

- Build fixes for Android from Mike Frysinger

- Don't display the MOTD when an explicit command is run from Guilhem Moulin

- Check curve25519 shared secret isn't zero

2015.68 - Saturday 8 August 2015

- Reduce local data copying for improved efficiency. Measured 30%
  increase in throughput for connections to localhost

- Forwarded TCP ports connect asynchronously and try all available addresses
  (IPv4, IPv6, round robin DNS)

- Fix all compile warnings, many patches from Gaël Portay
  Note that configure with -Werror may not be successful on some platforms (OS X)
  and some configuration options may still result in unused variable
  warnings.

- Use TCP Fast Open on Linux if available. Saves a round trip at connection
  to hosts that have previously been connected.
  Needs a recent Linux kernel and possibly "sysctl -w net.ipv4.tcp_fastopen=3"
  Client side is disabled by default pending further compatibility testing
  with networks and systems.

- Increase maximum command length to 9000 bytes

- Free memory before exiting, patch from Thorsten Horstmann. Useful for
  Dropbear ports to embedded systems and for checking memory leaks
  with valgrind. Only partially implemented for dbclient.
  This is disabled by default, enable with DROPBEAR_CLEANUP in sysoptions.h

- DROPBEAR_DEFAULT_CLI_AUTHKEY setting now always prepends home directory unless
  there is a leading slash (~ isn't treated specially)

- Fix small ECC memory leaks

- Tighten validation of Diffie-Hellman parameters, from Florent Daigniere of
  Matta Consulting. Odds of bad values are around 2**-512 -- improbable.

- Twofish-ctr cipher is supported though disabled by default

- Fix pre-authentication timeout when waiting for client SSH-2.0 banner, thanks
  to CL Ouyang

- Fix null pointer crash with restrictions in authorized_keys without a command, patch from
  Guilhem Moulin

- Ensure authentication timeout is handled while reading the initial banner,
  thanks to CL Ouyang for finding it.

- Fix null pointer crash when handling bad ECC keys. Found by afl-fuzz

2015.67 - Wednesday 28 January 2015

- Call fsync() after generating private keys to ensure they aren't lost if a
  reboot occurs. Thanks to Peter Korsgaard

- Disable non-delayed zlib compression by default on the server. Can be
  enabled if required for old clients with DROPBEAR_SERVER_DELAY_ZLIB

- Default client key path ~/.ssh/id_dropbear

- Prefer stronger algorithms by default, from Fedor Brunner.
  AES256 over 3DES
  Diffie-hellman group14 over group1

- Add option to disable CBC ciphers.

- Disable twofish in default options.h

- Enable sha2 HMAC algorithms by default, the code was already required
  for ECC key exchange. sha1 is the first preference still for performance.

- Fix installing dropbear.8 in a separate build directory, from Like Ma

- Allow configure to succeed if libtomcrypt/libtommath are missing, from Elan Ruusamäe

- Don't crash if ssh-agent provides an unknown type of key. From Catalin Patulea

- Minor bug fixes, a few issues found by Coverity scan

2014.66 - Thursday 23 October 2014

- Use the same keepalive handling behaviour as OpenSSH. This will work better
  with some SSH implementations that have different behaviour with unknown
  message types.

- Don't reply with SSH_MSG_UNIMPLEMENTED when we receive a reply to our own
  keepalive message

- Set $SSH_CLIENT to keep bash happy, patch from Ryan Cleere

- Fix wtmp which broke since 2013.62, patch from Whoopie

2014.65 - Friday 8 August 2014

- Fix 2014.64 regression, server session hang on exit with scp (and probably
  others), thanks to NiLuJe for tracking it down

- Fix 2014.64 regression, clock_gettime() error handling which broke on older
  Linux kernels, reported by NiLuJe

- Fix 2014.64 regression, writev() could occassionally fail with EAGAIN which
  wasn't caught

- Avoid error message when trying to set QoS on proxycommand or multihop pipes

- Use /usr/bin/xauth, thanks to Mike Frysinger

- Don't exit the client if the local user entry can't be found, thanks to iquaba

2014.64 - Sunday 27 July 2014

- Fix compiling with ECDSA and DSS disabled

- Don't exit abruptly if too many outgoing packets are queued for writev(). Patch
  thanks to Ronny Meeus

- The -K keepalive option now behaves more like OpenSSH's "ServerAliveInterval".
  If no response is received after 3 keepalives then the session is terminated. This
  will close connections faster than waiting for a TCP timeout.

- Rework TCP priority setting. New settings are
	if (connecting || ptys || x11) tos = LOWDELAY
	else if (tcp_forwards) tos = 0
	else tos = BULK
  Thanks to Catalin Patulea for the suggestion.

- Improve handling of many concurrent new TCP forwarded connections, should now
  be able to handle as many as MAX_CHANNELS. Thanks to Eduardo Silva for reporting
  and investigating it.

- Make sure that exit messages from the client are printed, regression in 2013.57

- Use monotonic clock where available, timeouts won't be affected by system time
  changes

- Add -V for version

2014.63 - Wednesday 19 February 2014

- Fix ~. to terminate a client interactive session after waking a laptop
  from sleep.

- Changed port separator syntax again, now using host^port. This is because
  IPv6 link-local addresses use %. Reported by Gui Iribarren

- Avoid constantly relinking dropbearmulti target, fix "make install"
  for multi target, thanks to Mike Frysinger

- Avoid getting stuck in a loop writing huge key files, reported by Bruno
  Thomsen

- Don't link dropbearkey or dropbearconvert to libz or libutil,
  thanks to Nicolas Boos

- Fix linking -lcrypt on systems without /usr/lib, thanks to Nicolas Boos

- Avoid crash on exit due to cleaned up keys before last packets are sent,
  debugged by Ronald Wahl

- Fix a race condition in rekeying where Dropbear would exit if it received a
  still-in-flight packet after initiating rekeying. Reported by Oliver Metz.
  This is a longstanding bug but is triggered more easily since 2013.57

- Fix README for ecdsa keys, from Catalin Patulea

- Ensure that generated RSA keys are always exactly the length
  requested. Previously Dropbear always generated N+16 or N+15 bit keys.
  Thanks to Unit 193

- Fix DROPBEAR_CLI_IMMEDIATE_AUTH mode which saves a network round trip if the
  first public key succeeds. Still not enabled by default, needs more
  compatibility testing with other implementations.

- Fix for port 0 forwarding in the client and port forwarding with Apache MINA SSHD.

- Fix for bad system linux/pkt-sched.h header file with older Linux
kernels, from Steve Dover

- Fix signal handlers so that errno is saved, thanks to Erik Ahlén for a patch
  and Mark Wickham for independently spotting the same problem.
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue May 29, 2017
security/dropbear: security fix

Revisions pulled up:
- security/dropbear/Makefile                                    1.32
- security/dropbear/distinfo                                    1.24
- security/dropbear/patches/patch-aa                            1.11
- security/dropbear/patches/patch-ab                            1.9
- security/dropbear/patches/patch-configure                     1.1

---
   Module Name:    pkgsrc
   Committed By:   snj
   Date:           Tue May 16 21:54:21 UTC 2017

   Modified Files:
           pkgsrc/security/dropbear: Makefile distinfo
           pkgsrc/security/dropbear/patches: patch-aa patch-ab
   Added Files:
           pkgsrc/security/dropbear/patches: patch-configure

   Log Message:
   update dropbear to 2016.74.  changes:

   2016.74 - 21 July 2016

   - Security: Message printout was vulnerable to format string injection.

     If specific usernames including "%" symbols can be created on a system
     (validated by getpwnam()) then an attacker could run arbitrary code as
   root
     when connecting to Dropbear server.

     A dbclient user who can control username or host arguments could
   potentially
     run arbitrary code as the dbclient user. This could be a problem if
   scripts
     or webpages pass untrusted input to the dbclient program.
     CVE-2016-7406
     https://secure.ucc.asn.au/hg/dropbear/rev/b66a483f3dcb

   - Security: dropbearconvert import of OpenSSH keys could run arbitrary
   code as
     the local dropbearconvert user when parsing malicious key files
     CVE-2016-7407
     https://secure.ucc.asn.au/hg/dropbear/rev/34e6127ef02e

   - Security: dbclient could run arbitrary code as the local dbclient user if
     particular -m or -c arguments are provided. This could be an issue where
     dbclient is used in scripts.
     CVE-2016-7408
     https://secure.ucc.asn.au/hg/dropbear/rev/eed9376a4ad6

   - Security: dbclient or dropbear server could expose process memory to the
     running user if compiled with DEBUG_TRACE and running with -v
     CVE-2016-7409
     https://secure.ucc.asn.au/hg/dropbear/rev/6a14b1f6dc04

     The security issues were reported by an anonymous researcher working with
     Beyond Security's SecuriTeam Secure Disclosure
   www.beyondsecurity.com/ssd.html

   - Fix port forwarding failure when connecting to domains that have both
     IPv4 and IPv6 addresses. The bug was introduced in 2015.68

   - Fix 100% CPU use while waiting for rekey to complete. Thanks to Zhang
   Hui P
     for the patch

   2016.73 - 18 March 2016

   - Support syslog in dbclient, option -o usesyslog=yes. Patch from
   Konstantin Tokarev

   - Kill a proxycommand when dbclient exits, patch from Konstantin Tokarev

   - Option to exit when a TCP forward fails, patch from Konstantin Tokarev

   - New "-o" option parsing from Konstantin Tokarev. This allows handling
   some extra options
     in the style of OpenSSH, though implementing all OpenSSH options is
   not planned.

   - Fix crash when fallback initshells() is used, reported by Michael
   Nowak and Mike Tzou

   - Allow specifying commands eg "dropbearmulti dbclient ..." instead of
   symlinks

   - Various cleanups for issues found by a lint tool, patch from Francois
   Perrad

   - Fix tab indent consistency, patch from Francois Perrad

   - Fix issues found by cppcheck, reported by Mike Tzou

   - Use system memset_s() or explicit_bzero() if available to clear
   memory. Also make
     libtomcrypt/libtommath routines use that (or Dropbear's own m_burn()).

   - Prevent scp failing when the local user doesn't exist. Based on patch
   from Michael Witten.

   - Improved Travis CI test running, thanks to Mike Tzou

   - Improve some code that was flagged by Coverity and Fortify Static Code
   Analyzer

   2016.72 - 9 March 2016

   - Validate X11 forwarding input. Could allow bypass of authorized_keys
   command= restrictions,
     found by github.com/tintinweb. Thanks for Damien Miller for a patch.
   CVE-2016-3116
     https://secure.ucc.asn.au/hg/dropbear/rev/a3e8389e01ff

   2015.71 - 3 December 2015

   - Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

   - Fix crash on exit when -p address:port is used, broke in 2015.68,
   thanks to
     Frank Stollenwerk for reporting and investigation

   - Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from
   Konstantin Tokarev

   - Fix bad configure script test which didn't work with dash shell, patch
   from Juergen Daubert,
     broke in 2015.70

   - Fix server race condition that could cause sessions to hang on exit,
     MarketSquare/SSHLibrary#128

   2015.70 - 26 November 2015

   - Fix server password authentication on Linux, broke in 2015.69

   2015.69 - 25 November 2015

   - Fix crash when forwarded TCP connections fail to connect (bug
   introduced in 2015.68)

   - Avoid hang on session close when multiple sessions are started,
   affects Qt Creator
     Patch from Andrzej Szombierski

   - Reduce per-channel memory consumption in common case, increase default
     channel limit from 100 to 1000 which should improve SOCKS forwarding
   for modern
     webpages

   - Handle multiple command line arguments in a single flag, thanks to
   Guilhem Moulin

   - Manpage improvements from Guilhem Moulin

   - Build fixes for Android from Mike Frysinger

   - Don't display the MOTD when an explicit command is run from Guilhem Moulin

   - Check curve25519 shared secret isn't zero

   2015.68 - Saturday 8 August 2015

   - Reduce local data copying for improved efficiency. Measured 30%
     increase in throughput for connections to localhost

   - Forwarded TCP ports connect asynchronously and try all available addresses
     (IPv4, IPv6, round robin DNS)

   - Fix all compile warnings, many patches from Gaël Portay
     Note that configure with -Werror may not be successful on some
   platforms (OS X)
     and some configuration options may still result in unused variable
     warnings.

   - Use TCP Fast Open on Linux if available. Saves a round trip at connection
     to hosts that have previously been connected.
     Needs a recent Linux kernel and possibly "sysctl -w
   net.ipv4.tcp_fastopen=3"
     Client side is disabled by default pending further compatibility testing
     with networks and systems.

   - Increase maximum command length to 9000 bytes

   - Free memory before exiting, patch from Thorsten Horstmann. Useful for
     Dropbear ports to embedded systems and for checking memory leaks
     with valgrind. Only partially implemented for dbclient.
     This is disabled by default, enable with DROPBEAR_CLEANUP in sysoptions.h

   - DROPBEAR_DEFAULT_CLI_AUTHKEY setting now always prepends home
   directory unless
     there is a leading slash (~ isn't treated specially)

   - Fix small ECC memory leaks

   - Tighten validation of Diffie-Hellman parameters, from Florent Daigniere of
     Matta Consulting. Odds of bad values are around 2**-512 -- improbable.

   - Twofish-ctr cipher is supported though disabled by default

   - Fix pre-authentication timeout when waiting for client SSH-2.0 banner,
   thanks
     to CL Ouyang

   - Fix null pointer crash with restrictions in authorized_keys without a
   command, patch from
     Guilhem Moulin

   - Ensure authentication timeout is handled while reading the initial banner,
     thanks to CL Ouyang for finding it.

   - Fix null pointer crash when handling bad ECC keys. Found by afl-fuzz

   2015.67 - Wednesday 28 January 2015

   - Call fsync() after generating private keys to ensure they aren't lost if a
     reboot occurs. Thanks to Peter Korsgaard

   - Disable non-delayed zlib compression by default on the server. Can be
     enabled if required for old clients with DROPBEAR_SERVER_DELAY_ZLIB

   - Default client key path ~/.ssh/id_dropbear

   - Prefer stronger algorithms by default, from Fedor Brunner.
     AES256 over 3DES
     Diffie-hellman group14 over group1

   - Add option to disable CBC ciphers.

   - Disable twofish in default options.h

   - Enable sha2 HMAC algorithms by default, the code was already required
     for ECC key exchange. sha1 is the first preference still for performance.

   - Fix installing dropbear.8 in a separate build directory, from Like Ma

   - Allow configure to succeed if libtomcrypt/libtommath are missing, from
   Elan Ruusamäe

   - Don't crash if ssh-agent provides an unknown type of key. From Catalin
   Patulea

   - Minor bug fixes, a few issues found by Coverity scan

   2014.66 - Thursday 23 October 2014

   - Use the same keepalive handling behaviour as OpenSSH. This will work
   better
     with some SSH implementations that have different behaviour with unknown
     message types.

   - Don't reply with SSH_MSG_UNIMPLEMENTED when we receive a reply to our own
     keepalive message

   - Set $SSH_CLIENT to keep bash happy, patch from Ryan Cleere

   - Fix wtmp which broke since 2013.62, patch from Whoopie

   2014.65 - Friday 8 August 2014

   - Fix 2014.64 regression, server session hang on exit with scp (and probably
     others), thanks to NiLuJe for tracking it down

   - Fix 2014.64 regression, clock_gettime() error handling which broke on
   older
     Linux kernels, reported by NiLuJe

   - Fix 2014.64 regression, writev() could occassionally fail with EAGAIN
   which
     wasn't caught

   - Avoid error message when trying to set QoS on proxycommand or multihop
   pipes

   - Use /usr/bin/xauth, thanks to Mike Frysinger

   - Don't exit the client if the local user entry can't be found, thanks
   to iquaba

   2014.64 - Sunday 27 July 2014

   - Fix compiling with ECDSA and DSS disabled

   - Don't exit abruptly if too many outgoing packets are queued for
   writev(). Patch
     thanks to Ronny Meeus

   - The -K keepalive option now behaves more like OpenSSH's
   "ServerAliveInterval".
     If no response is received after 3 keepalives then the session is
   terminated. This
     will close connections faster than waiting for a TCP timeout.

   - Rework TCP priority setting. New settings are
           if (connecting || ptys || x11) tos = LOWDELAY
           else if (tcp_forwards) tos = 0
           else tos = BULK
     Thanks to Catalin Patulea for the suggestion.

   - Improve handling of many concurrent new TCP forwarded connections,
   should now
     be able to handle as many as MAX_CHANNELS. Thanks to Eduardo Silva for
   reporting
     and investigating it.

   - Make sure that exit messages from the client are printed, regression
   in 2013.57

   - Use monotonic clock where available, timeouts won't be affected by
   system time
     changes

   - Add -V for version

   2014.63 - Wednesday 19 February 2014

   - Fix ~. to terminate a client interactive session after waking a laptop
     from sleep.

   - Changed port separator syntax again, now using host^port. This is because
     IPv6 link-local addresses use %. Reported by Gui Iribarren

   - Avoid constantly relinking dropbearmulti target, fix "make install"
     for multi target, thanks to Mike Frysinger

   - Avoid getting stuck in a loop writing huge key files, reported by Bruno
     Thomsen

   - Don't link dropbearkey or dropbearconvert to libz or libutil,
     thanks to Nicolas Boos

   - Fix linking -lcrypt on systems without /usr/lib, thanks to Nicolas Boos

   - Avoid crash on exit due to cleaned up keys before last packets are sent,
     debugged by Ronald Wahl

   - Fix a race condition in rekeying where Dropbear would exit if it
   received a
     still-in-flight packet after initiating rekeying. Reported by Oliver Metz.
     This is a longstanding bug but is triggered more easily since 2013.57

   - Fix README for ecdsa keys, from Catalin Patulea

   - Ensure that generated RSA keys are always exactly the length
     requested. Previously Dropbear always generated N+16 or N+15 bit keys.
     Thanks to Unit 193

   - Fix DROPBEAR_CLI_IMMEDIATE_AUTH mode which saves a network round trip
   if the
     first public key succeeds. Still not enabled by default, needs more
     compatibility testing with other implementations.

   - Fix for port 0 forwarding in the client and port forwarding with
   Apache MINA SSHD.

   - Fix for bad system linux/pkt-sched.h header file with older Linux
   kernels, from Steve Dover

   - Fix signal handlers so that errno is saved, thanks to Erik Ahl�n for a
   patch
     and Mark Wickham for independently spotting the same problem.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jun 9, 2017
security/dropbear: security fix

Revisions pulled up:
- security/dropbear/Makefile                                    1.32
- security/dropbear/distinfo                                    1.24
- security/dropbear/patches/patch-aa                            1.11
- security/dropbear/patches/patch-ab                            1.9
- security/dropbear/patches/patch-configure                     1.1

---
   Module Name:    pkgsrc
   Committed By:   snj
   Date:           Tue May 16 21:54:21 UTC 2017

   Modified Files:
           pkgsrc/security/dropbear: Makefile distinfo
           pkgsrc/security/dropbear/patches: patch-aa patch-ab
   Added Files:
           pkgsrc/security/dropbear/patches: patch-configure

   Log Message:
   update dropbear to 2016.74.  changes:

   2016.74 - 21 July 2016

   - Security: Message printout was vulnerable to format string injection.

     If specific usernames including "%" symbols can be created on a system
     (validated by getpwnam()) then an attacker could run arbitrary code as
   root
     when connecting to Dropbear server.

     A dbclient user who can control username or host arguments could
   potentially
     run arbitrary code as the dbclient user. This could be a problem if
   scripts
     or webpages pass untrusted input to the dbclient program.
     CVE-2016-7406
     https://secure.ucc.asn.au/hg/dropbear/rev/b66a483f3dcb

   - Security: dropbearconvert import of OpenSSH keys could run arbitrary
   code as
     the local dropbearconvert user when parsing malicious key files
     CVE-2016-7407
     https://secure.ucc.asn.au/hg/dropbear/rev/34e6127ef02e

   - Security: dbclient could run arbitrary code as the local dbclient user if
     particular -m or -c arguments are provided. This could be an issue where
     dbclient is used in scripts.
     CVE-2016-7408
     https://secure.ucc.asn.au/hg/dropbear/rev/eed9376a4ad6

   - Security: dbclient or dropbear server could expose process memory to the
     running user if compiled with DEBUG_TRACE and running with -v
     CVE-2016-7409
     https://secure.ucc.asn.au/hg/dropbear/rev/6a14b1f6dc04

     The security issues were reported by an anonymous researcher working with
     Beyond Security's SecuriTeam Secure Disclosure
   www.beyondsecurity.com/ssd.html

   - Fix port forwarding failure when connecting to domains that have both
     IPv4 and IPv6 addresses. The bug was introduced in 2015.68

   - Fix 100% CPU use while waiting for rekey to complete. Thanks to Zhang
   Hui P
     for the patch

   2016.73 - 18 March 2016

   - Support syslog in dbclient, option -o usesyslog=yes. Patch from
   Konstantin Tokarev

   - Kill a proxycommand when dbclient exits, patch from Konstantin Tokarev

   - Option to exit when a TCP forward fails, patch from Konstantin Tokarev

   - New "-o" option parsing from Konstantin Tokarev. This allows handling
   some extra options
     in the style of OpenSSH, though implementing all OpenSSH options is
   not planned.

   - Fix crash when fallback initshells() is used, reported by Michael
   Nowak and Mike Tzou

   - Allow specifying commands eg "dropbearmulti dbclient ..." instead of
   symlinks

   - Various cleanups for issues found by a lint tool, patch from Francois
   Perrad

   - Fix tab indent consistency, patch from Francois Perrad

   - Fix issues found by cppcheck, reported by Mike Tzou

   - Use system memset_s() or explicit_bzero() if available to clear
   memory. Also make
     libtomcrypt/libtommath routines use that (or Dropbear's own m_burn()).

   - Prevent scp failing when the local user doesn't exist. Based on patch
   from Michael Witten.

   - Improved Travis CI test running, thanks to Mike Tzou

   - Improve some code that was flagged by Coverity and Fortify Static Code
   Analyzer

   2016.72 - 9 March 2016

   - Validate X11 forwarding input. Could allow bypass of authorized_keys
   command= restrictions,
     found by github.com/tintinweb. Thanks for Damien Miller for a patch.
   CVE-2016-3116
     https://secure.ucc.asn.au/hg/dropbear/rev/a3e8389e01ff

   2015.71 - 3 December 2015

   - Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

   - Fix crash on exit when -p address:port is used, broke in 2015.68,
   thanks to
     Frank Stollenwerk for reporting and investigation

   - Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from
   Konstantin Tokarev

   - Fix bad configure script test which didn't work with dash shell, patch
   from Juergen Daubert,
     broke in 2015.70

   - Fix server race condition that could cause sessions to hang on exit,
     MarketSquare/SSHLibrary#128

   2015.70 - 26 November 2015

   - Fix server password authentication on Linux, broke in 2015.69

   2015.69 - 25 November 2015

   - Fix crash when forwarded TCP connections fail to connect (bug
   introduced in 2015.68)

   - Avoid hang on session close when multiple sessions are started,
   affects Qt Creator
     Patch from Andrzej Szombierski

   - Reduce per-channel memory consumption in common case, increase default
     channel limit from 100 to 1000 which should improve SOCKS forwarding
   for modern
     webpages

   - Handle multiple command line arguments in a single flag, thanks to
   Guilhem Moulin

   - Manpage improvements from Guilhem Moulin

   - Build fixes for Android from Mike Frysinger

   - Don't display the MOTD when an explicit command is run from Guilhem Moulin

   - Check curve25519 shared secret isn't zero

   2015.68 - Saturday 8 August 2015

   - Reduce local data copying for improved efficiency. Measured 30%
     increase in throughput for connections to localhost

   - Forwarded TCP ports connect asynchronously and try all available addresses
     (IPv4, IPv6, round robin DNS)

   - Fix all compile warnings, many patches from Gaël Portay
     Note that configure with -Werror may not be successful on some
   platforms (OS X)
     and some configuration options may still result in unused variable
     warnings.

   - Use TCP Fast Open on Linux if available. Saves a round trip at connection
     to hosts that have previously been connected.
     Needs a recent Linux kernel and possibly "sysctl -w
   net.ipv4.tcp_fastopen=3"
     Client side is disabled by default pending further compatibility testing
     with networks and systems.

   - Increase maximum command length to 9000 bytes

   - Free memory before exiting, patch from Thorsten Horstmann. Useful for
     Dropbear ports to embedded systems and for checking memory leaks
     with valgrind. Only partially implemented for dbclient.
     This is disabled by default, enable with DROPBEAR_CLEANUP in sysoptions.h

   - DROPBEAR_DEFAULT_CLI_AUTHKEY setting now always prepends home
   directory unless
     there is a leading slash (~ isn't treated specially)

   - Fix small ECC memory leaks

   - Tighten validation of Diffie-Hellman parameters, from Florent Daigniere of
     Matta Consulting. Odds of bad values are around 2**-512 -- improbable.

   - Twofish-ctr cipher is supported though disabled by default

   - Fix pre-authentication timeout when waiting for client SSH-2.0 banner,
   thanks
     to CL Ouyang

   - Fix null pointer crash with restrictions in authorized_keys without a
   command, patch from
     Guilhem Moulin

   - Ensure authentication timeout is handled while reading the initial banner,
     thanks to CL Ouyang for finding it.

   - Fix null pointer crash when handling bad ECC keys. Found by afl-fuzz

   2015.67 - Wednesday 28 January 2015

   - Call fsync() after generating private keys to ensure they aren't lost if a
     reboot occurs. Thanks to Peter Korsgaard

   - Disable non-delayed zlib compression by default on the server. Can be
     enabled if required for old clients with DROPBEAR_SERVER_DELAY_ZLIB

   - Default client key path ~/.ssh/id_dropbear

   - Prefer stronger algorithms by default, from Fedor Brunner.
     AES256 over 3DES
     Diffie-hellman group14 over group1

   - Add option to disable CBC ciphers.

   - Disable twofish in default options.h

   - Enable sha2 HMAC algorithms by default, the code was already required
     for ECC key exchange. sha1 is the first preference still for performance.

   - Fix installing dropbear.8 in a separate build directory, from Like Ma

   - Allow configure to succeed if libtomcrypt/libtommath are missing, from
   Elan Ruusamäe

   - Don't crash if ssh-agent provides an unknown type of key. From Catalin
   Patulea

   - Minor bug fixes, a few issues found by Coverity scan

   2014.66 - Thursday 23 October 2014

   - Use the same keepalive handling behaviour as OpenSSH. This will work
   better
     with some SSH implementations that have different behaviour with unknown
     message types.

   - Don't reply with SSH_MSG_UNIMPLEMENTED when we receive a reply to our own
     keepalive message

   - Set $SSH_CLIENT to keep bash happy, patch from Ryan Cleere

   - Fix wtmp which broke since 2013.62, patch from Whoopie

   2014.65 - Friday 8 August 2014

   - Fix 2014.64 regression, server session hang on exit with scp (and probably
     others), thanks to NiLuJe for tracking it down

   - Fix 2014.64 regression, clock_gettime() error handling which broke on
   older
     Linux kernels, reported by NiLuJe

   - Fix 2014.64 regression, writev() could occassionally fail with EAGAIN
   which
     wasn't caught

   - Avoid error message when trying to set QoS on proxycommand or multihop
   pipes

   - Use /usr/bin/xauth, thanks to Mike Frysinger

   - Don't exit the client if the local user entry can't be found, thanks
   to iquaba

   2014.64 - Sunday 27 July 2014

   - Fix compiling with ECDSA and DSS disabled

   - Don't exit abruptly if too many outgoing packets are queued for
   writev(). Patch
     thanks to Ronny Meeus

   - The -K keepalive option now behaves more like OpenSSH's
   "ServerAliveInterval".
     If no response is received after 3 keepalives then the session is
   terminated. This
     will close connections faster than waiting for a TCP timeout.

   - Rework TCP priority setting. New settings are
           if (connecting || ptys || x11) tos = LOWDELAY
           else if (tcp_forwards) tos = 0
           else tos = BULK
     Thanks to Catalin Patulea for the suggestion.

   - Improve handling of many concurrent new TCP forwarded connections,
   should now
     be able to handle as many as MAX_CHANNELS. Thanks to Eduardo Silva for
   reporting
     and investigating it.

   - Make sure that exit messages from the client are printed, regression
   in 2013.57

   - Use monotonic clock where available, timeouts won't be affected by
   system time
     changes

   - Add -V for version

   2014.63 - Wednesday 19 February 2014

   - Fix ~. to terminate a client interactive session after waking a laptop
     from sleep.

   - Changed port separator syntax again, now using host^port. This is because
     IPv6 link-local addresses use %. Reported by Gui Iribarren

   - Avoid constantly relinking dropbearmulti target, fix "make install"
     for multi target, thanks to Mike Frysinger

   - Avoid getting stuck in a loop writing huge key files, reported by Bruno
     Thomsen

   - Don't link dropbearkey or dropbearconvert to libz or libutil,
     thanks to Nicolas Boos

   - Fix linking -lcrypt on systems without /usr/lib, thanks to Nicolas Boos

   - Avoid crash on exit due to cleaned up keys before last packets are sent,
     debugged by Ronald Wahl

   - Fix a race condition in rekeying where Dropbear would exit if it
   received a
     still-in-flight packet after initiating rekeying. Reported by Oliver Metz.
     This is a longstanding bug but is triggered more easily since 2013.57

   - Fix README for ecdsa keys, from Catalin Patulea

   - Ensure that generated RSA keys are always exactly the length
     requested. Previously Dropbear always generated N+16 or N+15 bit keys.
     Thanks to Unit 193

   - Fix DROPBEAR_CLI_IMMEDIATE_AUTH mode which saves a network round trip
   if the
     first public key succeeds. Still not enabled by default, needs more
     compatibility testing with other implementations.

   - Fix for port 0 forwarding in the client and port forwarding with
   Apache MINA SSHD.

   - Fix for bad system linux/pkt-sched.h header file with older Linux
   kernels, from Steve Dover

   - Fix signal handlers so that errno is saved, thanks to Erik Ahl�n for a
   patch
     and Mark Wickham for independently spotting the same problem.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jun 22, 2017
security/dropbear: security fix

Revisions pulled up:
- security/dropbear/Makefile                                    1.32
- security/dropbear/distinfo                                    1.24
- security/dropbear/patches/patch-aa                            1.11
- security/dropbear/patches/patch-ab                            1.9
- security/dropbear/patches/patch-configure                     1.1

---
   Module Name:    pkgsrc
   Committed By:   snj
   Date:           Tue May 16 21:54:21 UTC 2017

   Modified Files:
           pkgsrc/security/dropbear: Makefile distinfo
           pkgsrc/security/dropbear/patches: patch-aa patch-ab
   Added Files:
           pkgsrc/security/dropbear/patches: patch-configure

   Log Message:
   update dropbear to 2016.74.  changes:

   2016.74 - 21 July 2016

   - Security: Message printout was vulnerable to format string injection.

     If specific usernames including "%" symbols can be created on a system
     (validated by getpwnam()) then an attacker could run arbitrary code as
   root
     when connecting to Dropbear server.

     A dbclient user who can control username or host arguments could
   potentially
     run arbitrary code as the dbclient user. This could be a problem if
   scripts
     or webpages pass untrusted input to the dbclient program.
     CVE-2016-7406
     https://secure.ucc.asn.au/hg/dropbear/rev/b66a483f3dcb

   - Security: dropbearconvert import of OpenSSH keys could run arbitrary
   code as
     the local dropbearconvert user when parsing malicious key files
     CVE-2016-7407
     https://secure.ucc.asn.au/hg/dropbear/rev/34e6127ef02e

   - Security: dbclient could run arbitrary code as the local dbclient user if
     particular -m or -c arguments are provided. This could be an issue where
     dbclient is used in scripts.
     CVE-2016-7408
     https://secure.ucc.asn.au/hg/dropbear/rev/eed9376a4ad6

   - Security: dbclient or dropbear server could expose process memory to the
     running user if compiled with DEBUG_TRACE and running with -v
     CVE-2016-7409
     https://secure.ucc.asn.au/hg/dropbear/rev/6a14b1f6dc04

     The security issues were reported by an anonymous researcher working with
     Beyond Security's SecuriTeam Secure Disclosure
   www.beyondsecurity.com/ssd.html

   - Fix port forwarding failure when connecting to domains that have both
     IPv4 and IPv6 addresses. The bug was introduced in 2015.68

   - Fix 100% CPU use while waiting for rekey to complete. Thanks to Zhang
   Hui P
     for the patch

   2016.73 - 18 March 2016

   - Support syslog in dbclient, option -o usesyslog=yes. Patch from
   Konstantin Tokarev

   - Kill a proxycommand when dbclient exits, patch from Konstantin Tokarev

   - Option to exit when a TCP forward fails, patch from Konstantin Tokarev

   - New "-o" option parsing from Konstantin Tokarev. This allows handling
   some extra options
     in the style of OpenSSH, though implementing all OpenSSH options is
   not planned.

   - Fix crash when fallback initshells() is used, reported by Michael
   Nowak and Mike Tzou

   - Allow specifying commands eg "dropbearmulti dbclient ..." instead of
   symlinks

   - Various cleanups for issues found by a lint tool, patch from Francois
   Perrad

   - Fix tab indent consistency, patch from Francois Perrad

   - Fix issues found by cppcheck, reported by Mike Tzou

   - Use system memset_s() or explicit_bzero() if available to clear
   memory. Also make
     libtomcrypt/libtommath routines use that (or Dropbear's own m_burn()).

   - Prevent scp failing when the local user doesn't exist. Based on patch
   from Michael Witten.

   - Improved Travis CI test running, thanks to Mike Tzou

   - Improve some code that was flagged by Coverity and Fortify Static Code
   Analyzer

   2016.72 - 9 March 2016

   - Validate X11 forwarding input. Could allow bypass of authorized_keys
   command= restrictions,
     found by github.com/tintinweb. Thanks for Damien Miller for a patch.
   CVE-2016-3116
     https://secure.ucc.asn.au/hg/dropbear/rev/a3e8389e01ff

   2015.71 - 3 December 2015

   - Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

   - Fix crash on exit when -p address:port is used, broke in 2015.68,
   thanks to
     Frank Stollenwerk for reporting and investigation

   - Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from
   Konstantin Tokarev

   - Fix bad configure script test which didn't work with dash shell, patch
   from Juergen Daubert,
     broke in 2015.70

   - Fix server race condition that could cause sessions to hang on exit,
     MarketSquare/SSHLibrary#128

   2015.70 - 26 November 2015

   - Fix server password authentication on Linux, broke in 2015.69

   2015.69 - 25 November 2015

   - Fix crash when forwarded TCP connections fail to connect (bug
   introduced in 2015.68)

   - Avoid hang on session close when multiple sessions are started,
   affects Qt Creator
     Patch from Andrzej Szombierski

   - Reduce per-channel memory consumption in common case, increase default
     channel limit from 100 to 1000 which should improve SOCKS forwarding
   for modern
     webpages

   - Handle multiple command line arguments in a single flag, thanks to
   Guilhem Moulin

   - Manpage improvements from Guilhem Moulin

   - Build fixes for Android from Mike Frysinger

   - Don't display the MOTD when an explicit command is run from Guilhem Moulin

   - Check curve25519 shared secret isn't zero

   2015.68 - Saturday 8 August 2015

   - Reduce local data copying for improved efficiency. Measured 30%
     increase in throughput for connections to localhost

   - Forwarded TCP ports connect asynchronously and try all available addresses
     (IPv4, IPv6, round robin DNS)

   - Fix all compile warnings, many patches from Gaël Portay
     Note that configure with -Werror may not be successful on some
   platforms (OS X)
     and some configuration options may still result in unused variable
     warnings.

   - Use TCP Fast Open on Linux if available. Saves a round trip at connection
     to hosts that have previously been connected.
     Needs a recent Linux kernel and possibly "sysctl -w
   net.ipv4.tcp_fastopen=3"
     Client side is disabled by default pending further compatibility testing
     with networks and systems.

   - Increase maximum command length to 9000 bytes

   - Free memory before exiting, patch from Thorsten Horstmann. Useful for
     Dropbear ports to embedded systems and for checking memory leaks
     with valgrind. Only partially implemented for dbclient.
     This is disabled by default, enable with DROPBEAR_CLEANUP in sysoptions.h

   - DROPBEAR_DEFAULT_CLI_AUTHKEY setting now always prepends home
   directory unless
     there is a leading slash (~ isn't treated specially)

   - Fix small ECC memory leaks

   - Tighten validation of Diffie-Hellman parameters, from Florent Daigniere of
     Matta Consulting. Odds of bad values are around 2**-512 -- improbable.

   - Twofish-ctr cipher is supported though disabled by default

   - Fix pre-authentication timeout when waiting for client SSH-2.0 banner,
   thanks
     to CL Ouyang

   - Fix null pointer crash with restrictions in authorized_keys without a
   command, patch from
     Guilhem Moulin

   - Ensure authentication timeout is handled while reading the initial banner,
     thanks to CL Ouyang for finding it.

   - Fix null pointer crash when handling bad ECC keys. Found by afl-fuzz

   2015.67 - Wednesday 28 January 2015

   - Call fsync() after generating private keys to ensure they aren't lost if a
     reboot occurs. Thanks to Peter Korsgaard

   - Disable non-delayed zlib compression by default on the server. Can be
     enabled if required for old clients with DROPBEAR_SERVER_DELAY_ZLIB

   - Default client key path ~/.ssh/id_dropbear

   - Prefer stronger algorithms by default, from Fedor Brunner.
     AES256 over 3DES
     Diffie-hellman group14 over group1

   - Add option to disable CBC ciphers.

   - Disable twofish in default options.h

   - Enable sha2 HMAC algorithms by default, the code was already required
     for ECC key exchange. sha1 is the first preference still for performance.

   - Fix installing dropbear.8 in a separate build directory, from Like Ma

   - Allow configure to succeed if libtomcrypt/libtommath are missing, from
   Elan Ruusamäe

   - Don't crash if ssh-agent provides an unknown type of key. From Catalin
   Patulea

   - Minor bug fixes, a few issues found by Coverity scan

   2014.66 - Thursday 23 October 2014

   - Use the same keepalive handling behaviour as OpenSSH. This will work
   better
     with some SSH implementations that have different behaviour with unknown
     message types.

   - Don't reply with SSH_MSG_UNIMPLEMENTED when we receive a reply to our own
     keepalive message

   - Set $SSH_CLIENT to keep bash happy, patch from Ryan Cleere

   - Fix wtmp which broke since 2013.62, patch from Whoopie

   2014.65 - Friday 8 August 2014

   - Fix 2014.64 regression, server session hang on exit with scp (and probably
     others), thanks to NiLuJe for tracking it down

   - Fix 2014.64 regression, clock_gettime() error handling which broke on
   older
     Linux kernels, reported by NiLuJe

   - Fix 2014.64 regression, writev() could occassionally fail with EAGAIN
   which
     wasn't caught

   - Avoid error message when trying to set QoS on proxycommand or multihop
   pipes

   - Use /usr/bin/xauth, thanks to Mike Frysinger

   - Don't exit the client if the local user entry can't be found, thanks
   to iquaba

   2014.64 - Sunday 27 July 2014

   - Fix compiling with ECDSA and DSS disabled

   - Don't exit abruptly if too many outgoing packets are queued for
   writev(). Patch
     thanks to Ronny Meeus

   - The -K keepalive option now behaves more like OpenSSH's
   "ServerAliveInterval".
     If no response is received after 3 keepalives then the session is
   terminated. This
     will close connections faster than waiting for a TCP timeout.

   - Rework TCP priority setting. New settings are
           if (connecting || ptys || x11) tos = LOWDELAY
           else if (tcp_forwards) tos = 0
           else tos = BULK
     Thanks to Catalin Patulea for the suggestion.

   - Improve handling of many concurrent new TCP forwarded connections,
   should now
     be able to handle as many as MAX_CHANNELS. Thanks to Eduardo Silva for
   reporting
     and investigating it.

   - Make sure that exit messages from the client are printed, regression
   in 2013.57

   - Use monotonic clock where available, timeouts won't be affected by
   system time
     changes

   - Add -V for version

   2014.63 - Wednesday 19 February 2014

   - Fix ~. to terminate a client interactive session after waking a laptop
     from sleep.

   - Changed port separator syntax again, now using host^port. This is because
     IPv6 link-local addresses use %. Reported by Gui Iribarren

   - Avoid constantly relinking dropbearmulti target, fix "make install"
     for multi target, thanks to Mike Frysinger

   - Avoid getting stuck in a loop writing huge key files, reported by Bruno
     Thomsen

   - Don't link dropbearkey or dropbearconvert to libz or libutil,
     thanks to Nicolas Boos

   - Fix linking -lcrypt on systems without /usr/lib, thanks to Nicolas Boos

   - Avoid crash on exit due to cleaned up keys before last packets are sent,
     debugged by Ronald Wahl

   - Fix a race condition in rekeying where Dropbear would exit if it
   received a
     still-in-flight packet after initiating rekeying. Reported by Oliver Metz.
     This is a longstanding bug but is triggered more easily since 2013.57

   - Fix README for ecdsa keys, from Catalin Patulea

   - Ensure that generated RSA keys are always exactly the length
     requested. Previously Dropbear always generated N+16 or N+15 bit keys.
     Thanks to Unit 193

   - Fix DROPBEAR_CLI_IMMEDIATE_AUTH mode which saves a network round trip
   if the
     first public key succeeds. Still not enabled by default, needs more
     compatibility testing with other implementations.

   - Fix for port 0 forwarding in the client and port forwarding with
   Apache MINA SSHD.

   - Fix for bad system linux/pkt-sched.h header file with older Linux
   kernels, from Steve Dover

   - Fix signal handlers so that errno is saved, thanks to Erik Ahl�n for a
   patch
     and Mark Wickham for independently spotting the same problem.
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jun 22, 2017
security/dropbear: security fix

Revisions pulled up:
- security/dropbear/Makefile                                    1.32
- security/dropbear/distinfo                                    1.24
- security/dropbear/patches/patch-aa                            1.11
- security/dropbear/patches/patch-ab                            1.9
- security/dropbear/patches/patch-configure                     1.1

---
   Module Name:    pkgsrc
   Committed By:   snj
   Date:           Tue May 16 21:54:21 UTC 2017

   Modified Files:
           pkgsrc/security/dropbear: Makefile distinfo
           pkgsrc/security/dropbear/patches: patch-aa patch-ab
   Added Files:
           pkgsrc/security/dropbear/patches: patch-configure

   Log Message:
   update dropbear to 2016.74.  changes:

   2016.74 - 21 July 2016

   - Security: Message printout was vulnerable to format string injection.

     If specific usernames including "%" symbols can be created on a system
     (validated by getpwnam()) then an attacker could run arbitrary code as
   root
     when connecting to Dropbear server.

     A dbclient user who can control username or host arguments could
   potentially
     run arbitrary code as the dbclient user. This could be a problem if
   scripts
     or webpages pass untrusted input to the dbclient program.
     CVE-2016-7406
     https://secure.ucc.asn.au/hg/dropbear/rev/b66a483f3dcb

   - Security: dropbearconvert import of OpenSSH keys could run arbitrary
   code as
     the local dropbearconvert user when parsing malicious key files
     CVE-2016-7407
     https://secure.ucc.asn.au/hg/dropbear/rev/34e6127ef02e

   - Security: dbclient could run arbitrary code as the local dbclient user if
     particular -m or -c arguments are provided. This could be an issue where
     dbclient is used in scripts.
     CVE-2016-7408
     https://secure.ucc.asn.au/hg/dropbear/rev/eed9376a4ad6

   - Security: dbclient or dropbear server could expose process memory to the
     running user if compiled with DEBUG_TRACE and running with -v
     CVE-2016-7409
     https://secure.ucc.asn.au/hg/dropbear/rev/6a14b1f6dc04

     The security issues were reported by an anonymous researcher working with
     Beyond Security's SecuriTeam Secure Disclosure
   www.beyondsecurity.com/ssd.html

   - Fix port forwarding failure when connecting to domains that have both
     IPv4 and IPv6 addresses. The bug was introduced in 2015.68

   - Fix 100% CPU use while waiting for rekey to complete. Thanks to Zhang
   Hui P
     for the patch

   2016.73 - 18 March 2016

   - Support syslog in dbclient, option -o usesyslog=yes. Patch from
   Konstantin Tokarev

   - Kill a proxycommand when dbclient exits, patch from Konstantin Tokarev

   - Option to exit when a TCP forward fails, patch from Konstantin Tokarev

   - New "-o" option parsing from Konstantin Tokarev. This allows handling
   some extra options
     in the style of OpenSSH, though implementing all OpenSSH options is
   not planned.

   - Fix crash when fallback initshells() is used, reported by Michael
   Nowak and Mike Tzou

   - Allow specifying commands eg "dropbearmulti dbclient ..." instead of
   symlinks

   - Various cleanups for issues found by a lint tool, patch from Francois
   Perrad

   - Fix tab indent consistency, patch from Francois Perrad

   - Fix issues found by cppcheck, reported by Mike Tzou

   - Use system memset_s() or explicit_bzero() if available to clear
   memory. Also make
     libtomcrypt/libtommath routines use that (or Dropbear's own m_burn()).

   - Prevent scp failing when the local user doesn't exist. Based on patch
   from Michael Witten.

   - Improved Travis CI test running, thanks to Mike Tzou

   - Improve some code that was flagged by Coverity and Fortify Static Code
   Analyzer

   2016.72 - 9 March 2016

   - Validate X11 forwarding input. Could allow bypass of authorized_keys
   command= restrictions,
     found by github.com/tintinweb. Thanks for Damien Miller for a patch.
   CVE-2016-3116
     https://secure.ucc.asn.au/hg/dropbear/rev/a3e8389e01ff

   2015.71 - 3 December 2015

   - Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

   - Fix crash on exit when -p address:port is used, broke in 2015.68,
   thanks to
     Frank Stollenwerk for reporting and investigation

   - Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from
   Konstantin Tokarev

   - Fix bad configure script test which didn't work with dash shell, patch
   from Juergen Daubert,
     broke in 2015.70

   - Fix server race condition that could cause sessions to hang on exit,
     MarketSquare/SSHLibrary#128

   2015.70 - 26 November 2015

   - Fix server password authentication on Linux, broke in 2015.69

   2015.69 - 25 November 2015

   - Fix crash when forwarded TCP connections fail to connect (bug
   introduced in 2015.68)

   - Avoid hang on session close when multiple sessions are started,
   affects Qt Creator
     Patch from Andrzej Szombierski

   - Reduce per-channel memory consumption in common case, increase default
     channel limit from 100 to 1000 which should improve SOCKS forwarding
   for modern
     webpages

   - Handle multiple command line arguments in a single flag, thanks to
   Guilhem Moulin

   - Manpage improvements from Guilhem Moulin

   - Build fixes for Android from Mike Frysinger

   - Don't display the MOTD when an explicit command is run from Guilhem Moulin

   - Check curve25519 shared secret isn't zero

   2015.68 - Saturday 8 August 2015

   - Reduce local data copying for improved efficiency. Measured 30%
     increase in throughput for connections to localhost

   - Forwarded TCP ports connect asynchronously and try all available addresses
     (IPv4, IPv6, round robin DNS)

   - Fix all compile warnings, many patches from Gaël Portay
     Note that configure with -Werror may not be successful on some
   platforms (OS X)
     and some configuration options may still result in unused variable
     warnings.

   - Use TCP Fast Open on Linux if available. Saves a round trip at connection
     to hosts that have previously been connected.
     Needs a recent Linux kernel and possibly "sysctl -w
   net.ipv4.tcp_fastopen=3"
     Client side is disabled by default pending further compatibility testing
     with networks and systems.

   - Increase maximum command length to 9000 bytes

   - Free memory before exiting, patch from Thorsten Horstmann. Useful for
     Dropbear ports to embedded systems and for checking memory leaks
     with valgrind. Only partially implemented for dbclient.
     This is disabled by default, enable with DROPBEAR_CLEANUP in sysoptions.h

   - DROPBEAR_DEFAULT_CLI_AUTHKEY setting now always prepends home
   directory unless
     there is a leading slash (~ isn't treated specially)

   - Fix small ECC memory leaks

   - Tighten validation of Diffie-Hellman parameters, from Florent Daigniere of
     Matta Consulting. Odds of bad values are around 2**-512 -- improbable.

   - Twofish-ctr cipher is supported though disabled by default

   - Fix pre-authentication timeout when waiting for client SSH-2.0 banner,
   thanks
     to CL Ouyang

   - Fix null pointer crash with restrictions in authorized_keys without a
   command, patch from
     Guilhem Moulin

   - Ensure authentication timeout is handled while reading the initial banner,
     thanks to CL Ouyang for finding it.

   - Fix null pointer crash when handling bad ECC keys. Found by afl-fuzz

   2015.67 - Wednesday 28 January 2015

   - Call fsync() after generating private keys to ensure they aren't lost if a
     reboot occurs. Thanks to Peter Korsgaard

   - Disable non-delayed zlib compression by default on the server. Can be
     enabled if required for old clients with DROPBEAR_SERVER_DELAY_ZLIB

   - Default client key path ~/.ssh/id_dropbear

   - Prefer stronger algorithms by default, from Fedor Brunner.
     AES256 over 3DES
     Diffie-hellman group14 over group1

   - Add option to disable CBC ciphers.

   - Disable twofish in default options.h

   - Enable sha2 HMAC algorithms by default, the code was already required
     for ECC key exchange. sha1 is the first preference still for performance.

   - Fix installing dropbear.8 in a separate build directory, from Like Ma

   - Allow configure to succeed if libtomcrypt/libtommath are missing, from
   Elan Ruusamäe

   - Don't crash if ssh-agent provides an unknown type of key. From Catalin
   Patulea

   - Minor bug fixes, a few issues found by Coverity scan

   2014.66 - Thursday 23 October 2014

   - Use the same keepalive handling behaviour as OpenSSH. This will work
   better
     with some SSH implementations that have different behaviour with unknown
     message types.

   - Don't reply with SSH_MSG_UNIMPLEMENTED when we receive a reply to our own
     keepalive message

   - Set $SSH_CLIENT to keep bash happy, patch from Ryan Cleere

   - Fix wtmp which broke since 2013.62, patch from Whoopie

   2014.65 - Friday 8 August 2014

   - Fix 2014.64 regression, server session hang on exit with scp (and probably
     others), thanks to NiLuJe for tracking it down

   - Fix 2014.64 regression, clock_gettime() error handling which broke on
   older
     Linux kernels, reported by NiLuJe

   - Fix 2014.64 regression, writev() could occassionally fail with EAGAIN
   which
     wasn't caught

   - Avoid error message when trying to set QoS on proxycommand or multihop
   pipes

   - Use /usr/bin/xauth, thanks to Mike Frysinger

   - Don't exit the client if the local user entry can't be found, thanks
   to iquaba

   2014.64 - Sunday 27 July 2014

   - Fix compiling with ECDSA and DSS disabled

   - Don't exit abruptly if too many outgoing packets are queued for
   writev(). Patch
     thanks to Ronny Meeus

   - The -K keepalive option now behaves more like OpenSSH's
   "ServerAliveInterval".
     If no response is received after 3 keepalives then the session is
   terminated. This
     will close connections faster than waiting for a TCP timeout.

   - Rework TCP priority setting. New settings are
           if (connecting || ptys || x11) tos = LOWDELAY
           else if (tcp_forwards) tos = 0
           else tos = BULK
     Thanks to Catalin Patulea for the suggestion.

   - Improve handling of many concurrent new TCP forwarded connections,
   should now
     be able to handle as many as MAX_CHANNELS. Thanks to Eduardo Silva for
   reporting
     and investigating it.

   - Make sure that exit messages from the client are printed, regression
   in 2013.57

   - Use monotonic clock where available, timeouts won't be affected by
   system time
     changes

   - Add -V for version

   2014.63 - Wednesday 19 February 2014

   - Fix ~. to terminate a client interactive session after waking a laptop
     from sleep.

   - Changed port separator syntax again, now using host^port. This is because
     IPv6 link-local addresses use %. Reported by Gui Iribarren

   - Avoid constantly relinking dropbearmulti target, fix "make install"
     for multi target, thanks to Mike Frysinger

   - Avoid getting stuck in a loop writing huge key files, reported by Bruno
     Thomsen

   - Don't link dropbearkey or dropbearconvert to libz or libutil,
     thanks to Nicolas Boos

   - Fix linking -lcrypt on systems without /usr/lib, thanks to Nicolas Boos

   - Avoid crash on exit due to cleaned up keys before last packets are sent,
     debugged by Ronald Wahl

   - Fix a race condition in rekeying where Dropbear would exit if it
   received a
     still-in-flight packet after initiating rekeying. Reported by Oliver Metz.
     This is a longstanding bug but is triggered more easily since 2013.57

   - Fix README for ecdsa keys, from Catalin Patulea

   - Ensure that generated RSA keys are always exactly the length
     requested. Previously Dropbear always generated N+16 or N+15 bit keys.
     Thanks to Unit 193

   - Fix DROPBEAR_CLI_IMMEDIATE_AUTH mode which saves a network round trip
   if the
     first public key succeeds. Still not enabled by default, needs more
     compatibility testing with other implementations.

   - Fix for port 0 forwarding in the client and port forwarding with
   Apache MINA SSHD.

   - Fix for bad system linux/pkt-sched.h header file with older Linux
   kernels, from Steve Dover

   - Fix signal handlers so that errno is saved, thanks to Erik Ahl�n for a
   patch
     and Mark Wickham for independently spotting the same problem.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 14, 2020
security/dropbear: security fix

Revisions pulled up:
- security/dropbear/Makefile                                    1.32
- security/dropbear/distinfo                                    1.24
- security/dropbear/patches/patch-aa                            1.11
- security/dropbear/patches/patch-ab                            1.9
- security/dropbear/patches/patch-configure                     1.1

---
   Module Name:    pkgsrc
   Committed By:   snj
   Date:           Tue May 16 21:54:21 UTC 2017

   Modified Files:
           pkgsrc/security/dropbear: Makefile distinfo
           pkgsrc/security/dropbear/patches: patch-aa patch-ab
   Added Files:
           pkgsrc/security/dropbear/patches: patch-configure

   Log Message:
   update dropbear to 2016.74.  changes:

   2016.74 - 21 July 2016

   - Security: Message printout was vulnerable to format string injection.

     If specific usernames including "%" symbols can be created on a system
     (validated by getpwnam()) then an attacker could run arbitrary code as
   root
     when connecting to Dropbear server.

     A dbclient user who can control username or host arguments could
   potentially
     run arbitrary code as the dbclient user. This could be a problem if
   scripts
     or webpages pass untrusted input to the dbclient program.
     CVE-2016-7406
     https://secure.ucc.asn.au/hg/dropbear/rev/b66a483f3dcb

   - Security: dropbearconvert import of OpenSSH keys could run arbitrary
   code as
     the local dropbearconvert user when parsing malicious key files
     CVE-2016-7407
     https://secure.ucc.asn.au/hg/dropbear/rev/34e6127ef02e

   - Security: dbclient could run arbitrary code as the local dbclient user if
     particular -m or -c arguments are provided. This could be an issue where
     dbclient is used in scripts.
     CVE-2016-7408
     https://secure.ucc.asn.au/hg/dropbear/rev/eed9376a4ad6

   - Security: dbclient or dropbear server could expose process memory to the
     running user if compiled with DEBUG_TRACE and running with -v
     CVE-2016-7409
     https://secure.ucc.asn.au/hg/dropbear/rev/6a14b1f6dc04

     The security issues were reported by an anonymous researcher working with
     Beyond Security's SecuriTeam Secure Disclosure
   www.beyondsecurity.com/ssd.html

   - Fix port forwarding failure when connecting to domains that have both
     IPv4 and IPv6 addresses. The bug was introduced in 2015.68

   - Fix 100% CPU use while waiting for rekey to complete. Thanks to Zhang
   Hui P
     for the patch

   2016.73 - 18 March 2016

   - Support syslog in dbclient, option -o usesyslog=yes. Patch from
   Konstantin Tokarev

   - Kill a proxycommand when dbclient exits, patch from Konstantin Tokarev

   - Option to exit when a TCP forward fails, patch from Konstantin Tokarev

   - New "-o" option parsing from Konstantin Tokarev. This allows handling
   some extra options
     in the style of OpenSSH, though implementing all OpenSSH options is
   not planned.

   - Fix crash when fallback initshells() is used, reported by Michael
   Nowak and Mike Tzou

   - Allow specifying commands eg "dropbearmulti dbclient ..." instead of
   symlinks

   - Various cleanups for issues found by a lint tool, patch from Francois
   Perrad

   - Fix tab indent consistency, patch from Francois Perrad

   - Fix issues found by cppcheck, reported by Mike Tzou

   - Use system memset_s() or explicit_bzero() if available to clear
   memory. Also make
     libtomcrypt/libtommath routines use that (or Dropbear's own m_burn()).

   - Prevent scp failing when the local user doesn't exist. Based on patch
   from Michael Witten.

   - Improved Travis CI test running, thanks to Mike Tzou

   - Improve some code that was flagged by Coverity and Fortify Static Code
   Analyzer

   2016.72 - 9 March 2016

   - Validate X11 forwarding input. Could allow bypass of authorized_keys
   command= restrictions,
     found by github.com/tintinweb. Thanks for Damien Miller for a patch.
   CVE-2016-3116
     https://secure.ucc.asn.au/hg/dropbear/rev/a3e8389e01ff

   2015.71 - 3 December 2015

   - Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

   - Fix crash on exit when -p address:port is used, broke in 2015.68,
   thanks to
     Frank Stollenwerk for reporting and investigation

   - Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from
   Konstantin Tokarev

   - Fix bad configure script test which didn't work with dash shell, patch
   from Juergen Daubert,
     broke in 2015.70

   - Fix server race condition that could cause sessions to hang on exit,
     MarketSquare/SSHLibrary#128

   2015.70 - 26 November 2015

   - Fix server password authentication on Linux, broke in 2015.69

   2015.69 - 25 November 2015

   - Fix crash when forwarded TCP connections fail to connect (bug
   introduced in 2015.68)

   - Avoid hang on session close when multiple sessions are started,
   affects Qt Creator
     Patch from Andrzej Szombierski

   - Reduce per-channel memory consumption in common case, increase default
     channel limit from 100 to 1000 which should improve SOCKS forwarding
   for modern
     webpages

   - Handle multiple command line arguments in a single flag, thanks to
   Guilhem Moulin

   - Manpage improvements from Guilhem Moulin

   - Build fixes for Android from Mike Frysinger

   - Don't display the MOTD when an explicit command is run from Guilhem Moulin

   - Check curve25519 shared secret isn't zero

   2015.68 - Saturday 8 August 2015

   - Reduce local data copying for improved efficiency. Measured 30%
     increase in throughput for connections to localhost

   - Forwarded TCP ports connect asynchronously and try all available addresses
     (IPv4, IPv6, round robin DNS)

   - Fix all compile warnings, many patches from Gaël Portay
     Note that configure with -Werror may not be successful on some
   platforms (OS X)
     and some configuration options may still result in unused variable
     warnings.

   - Use TCP Fast Open on Linux if available. Saves a round trip at connection
     to hosts that have previously been connected.
     Needs a recent Linux kernel and possibly "sysctl -w
   net.ipv4.tcp_fastopen=3"
     Client side is disabled by default pending further compatibility testing
     with networks and systems.

   - Increase maximum command length to 9000 bytes

   - Free memory before exiting, patch from Thorsten Horstmann. Useful for
     Dropbear ports to embedded systems and for checking memory leaks
     with valgrind. Only partially implemented for dbclient.
     This is disabled by default, enable with DROPBEAR_CLEANUP in sysoptions.h

   - DROPBEAR_DEFAULT_CLI_AUTHKEY setting now always prepends home
   directory unless
     there is a leading slash (~ isn't treated specially)

   - Fix small ECC memory leaks

   - Tighten validation of Diffie-Hellman parameters, from Florent Daigniere of
     Matta Consulting. Odds of bad values are around 2**-512 -- improbable.

   - Twofish-ctr cipher is supported though disabled by default

   - Fix pre-authentication timeout when waiting for client SSH-2.0 banner,
   thanks
     to CL Ouyang

   - Fix null pointer crash with restrictions in authorized_keys without a
   command, patch from
     Guilhem Moulin

   - Ensure authentication timeout is handled while reading the initial banner,
     thanks to CL Ouyang for finding it.

   - Fix null pointer crash when handling bad ECC keys. Found by afl-fuzz

   2015.67 - Wednesday 28 January 2015

   - Call fsync() after generating private keys to ensure they aren't lost if a
     reboot occurs. Thanks to Peter Korsgaard

   - Disable non-delayed zlib compression by default on the server. Can be
     enabled if required for old clients with DROPBEAR_SERVER_DELAY_ZLIB

   - Default client key path ~/.ssh/id_dropbear

   - Prefer stronger algorithms by default, from Fedor Brunner.
     AES256 over 3DES
     Diffie-hellman group14 over group1

   - Add option to disable CBC ciphers.

   - Disable twofish in default options.h

   - Enable sha2 HMAC algorithms by default, the code was already required
     for ECC key exchange. sha1 is the first preference still for performance.

   - Fix installing dropbear.8 in a separate build directory, from Like Ma

   - Allow configure to succeed if libtomcrypt/libtommath are missing, from
   Elan Ruusamäe

   - Don't crash if ssh-agent provides an unknown type of key. From Catalin
   Patulea

   - Minor bug fixes, a few issues found by Coverity scan

   2014.66 - Thursday 23 October 2014

   - Use the same keepalive handling behaviour as OpenSSH. This will work
   better
     with some SSH implementations that have different behaviour with unknown
     message types.

   - Don't reply with SSH_MSG_UNIMPLEMENTED when we receive a reply to our own
     keepalive message

   - Set $SSH_CLIENT to keep bash happy, patch from Ryan Cleere

   - Fix wtmp which broke since 2013.62, patch from Whoopie

   2014.65 - Friday 8 August 2014

   - Fix 2014.64 regression, server session hang on exit with scp (and probably
     others), thanks to NiLuJe for tracking it down

   - Fix 2014.64 regression, clock_gettime() error handling which broke on
   older
     Linux kernels, reported by NiLuJe

   - Fix 2014.64 regression, writev() could occassionally fail with EAGAIN
   which
     wasn't caught

   - Avoid error message when trying to set QoS on proxycommand or multihop
   pipes

   - Use /usr/bin/xauth, thanks to Mike Frysinger

   - Don't exit the client if the local user entry can't be found, thanks
   to iquaba

   2014.64 - Sunday 27 July 2014

   - Fix compiling with ECDSA and DSS disabled

   - Don't exit abruptly if too many outgoing packets are queued for
   writev(). Patch
     thanks to Ronny Meeus

   - The -K keepalive option now behaves more like OpenSSH's
   "ServerAliveInterval".
     If no response is received after 3 keepalives then the session is
   terminated. This
     will close connections faster than waiting for a TCP timeout.

   - Rework TCP priority setting. New settings are
           if (connecting || ptys || x11) tos = LOWDELAY
           else if (tcp_forwards) tos = 0
           else tos = BULK
     Thanks to Catalin Patulea for the suggestion.

   - Improve handling of many concurrent new TCP forwarded connections,
   should now
     be able to handle as many as MAX_CHANNELS. Thanks to Eduardo Silva for
   reporting
     and investigating it.

   - Make sure that exit messages from the client are printed, regression
   in 2013.57

   - Use monotonic clock where available, timeouts won't be affected by
   system time
     changes

   - Add -V for version

   2014.63 - Wednesday 19 February 2014

   - Fix ~. to terminate a client interactive session after waking a laptop
     from sleep.

   - Changed port separator syntax again, now using host^port. This is because
     IPv6 link-local addresses use %. Reported by Gui Iribarren

   - Avoid constantly relinking dropbearmulti target, fix "make install"
     for multi target, thanks to Mike Frysinger

   - Avoid getting stuck in a loop writing huge key files, reported by Bruno
     Thomsen

   - Don't link dropbearkey or dropbearconvert to libz or libutil,
     thanks to Nicolas Boos

   - Fix linking -lcrypt on systems without /usr/lib, thanks to Nicolas Boos

   - Avoid crash on exit due to cleaned up keys before last packets are sent,
     debugged by Ronald Wahl

   - Fix a race condition in rekeying where Dropbear would exit if it
   received a
     still-in-flight packet after initiating rekeying. Reported by Oliver Metz.
     This is a longstanding bug but is triggered more easily since 2013.57

   - Fix README for ecdsa keys, from Catalin Patulea

   - Ensure that generated RSA keys are always exactly the length
     requested. Previously Dropbear always generated N+16 or N+15 bit keys.
     Thanks to Unit 193

   - Fix DROPBEAR_CLI_IMMEDIATE_AUTH mode which saves a network round trip
   if the
     first public key succeeds. Still not enabled by default, needs more
     compatibility testing with other implementations.

   - Fix for port 0 forwarding in the client and port forwarding with
   Apache MINA SSHD.

   - Fix for bad system linux/pkt-sched.h header file with older Linux
   kernels, from Steve Dover

   - Fix signal handlers so that errno is saved, thanks to Erik Ahl�n for a
   patch
     and Mark Wickham for independently spotting the same problem.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue May 27, 2020
security/dropbear: security fix

Revisions pulled up:
- security/dropbear/Makefile                                    1.32
- security/dropbear/distinfo                                    1.24
- security/dropbear/patches/patch-aa                            1.11
- security/dropbear/patches/patch-ab                            1.9
- security/dropbear/patches/patch-configure                     1.1

---
   Module Name:    pkgsrc
   Committed By:   snj
   Date:           Tue May 16 21:54:21 UTC 2017

   Modified Files:
           pkgsrc/security/dropbear: Makefile distinfo
           pkgsrc/security/dropbear/patches: patch-aa patch-ab
   Added Files:
           pkgsrc/security/dropbear/patches: patch-configure

   Log Message:
   update dropbear to 2016.74.  changes:

   2016.74 - 21 July 2016

   - Security: Message printout was vulnerable to format string injection.

     If specific usernames including "%" symbols can be created on a system
     (validated by getpwnam()) then an attacker could run arbitrary code as
   root
     when connecting to Dropbear server.

     A dbclient user who can control username or host arguments could
   potentially
     run arbitrary code as the dbclient user. This could be a problem if
   scripts
     or webpages pass untrusted input to the dbclient program.
     CVE-2016-7406
     https://secure.ucc.asn.au/hg/dropbear/rev/b66a483f3dcb

   - Security: dropbearconvert import of OpenSSH keys could run arbitrary
   code as
     the local dropbearconvert user when parsing malicious key files
     CVE-2016-7407
     https://secure.ucc.asn.au/hg/dropbear/rev/34e6127ef02e

   - Security: dbclient could run arbitrary code as the local dbclient user if
     particular -m or -c arguments are provided. This could be an issue where
     dbclient is used in scripts.
     CVE-2016-7408
     https://secure.ucc.asn.au/hg/dropbear/rev/eed9376a4ad6

   - Security: dbclient or dropbear server could expose process memory to the
     running user if compiled with DEBUG_TRACE and running with -v
     CVE-2016-7409
     https://secure.ucc.asn.au/hg/dropbear/rev/6a14b1f6dc04

     The security issues were reported by an anonymous researcher working with
     Beyond Security's SecuriTeam Secure Disclosure
   www.beyondsecurity.com/ssd.html

   - Fix port forwarding failure when connecting to domains that have both
     IPv4 and IPv6 addresses. The bug was introduced in 2015.68

   - Fix 100% CPU use while waiting for rekey to complete. Thanks to Zhang
   Hui P
     for the patch

   2016.73 - 18 March 2016

   - Support syslog in dbclient, option -o usesyslog=yes. Patch from
   Konstantin Tokarev

   - Kill a proxycommand when dbclient exits, patch from Konstantin Tokarev

   - Option to exit when a TCP forward fails, patch from Konstantin Tokarev

   - New "-o" option parsing from Konstantin Tokarev. This allows handling
   some extra options
     in the style of OpenSSH, though implementing all OpenSSH options is
   not planned.

   - Fix crash when fallback initshells() is used, reported by Michael
   Nowak and Mike Tzou

   - Allow specifying commands eg "dropbearmulti dbclient ..." instead of
   symlinks

   - Various cleanups for issues found by a lint tool, patch from Francois
   Perrad

   - Fix tab indent consistency, patch from Francois Perrad

   - Fix issues found by cppcheck, reported by Mike Tzou

   - Use system memset_s() or explicit_bzero() if available to clear
   memory. Also make
     libtomcrypt/libtommath routines use that (or Dropbear's own m_burn()).

   - Prevent scp failing when the local user doesn't exist. Based on patch
   from Michael Witten.

   - Improved Travis CI test running, thanks to Mike Tzou

   - Improve some code that was flagged by Coverity and Fortify Static Code
   Analyzer

   2016.72 - 9 March 2016

   - Validate X11 forwarding input. Could allow bypass of authorized_keys
   command= restrictions,
     found by github.com/tintinweb. Thanks for Damien Miller for a patch.
   CVE-2016-3116
     https://secure.ucc.asn.au/hg/dropbear/rev/a3e8389e01ff

   2015.71 - 3 December 2015

   - Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

   - Fix crash on exit when -p address:port is used, broke in 2015.68,
   thanks to
     Frank Stollenwerk for reporting and investigation

   - Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from
   Konstantin Tokarev

   - Fix bad configure script test which didn't work with dash shell, patch
   from Juergen Daubert,
     broke in 2015.70

   - Fix server race condition that could cause sessions to hang on exit,
     MarketSquare/SSHLibrary#128

   2015.70 - 26 November 2015

   - Fix server password authentication on Linux, broke in 2015.69

   2015.69 - 25 November 2015

   - Fix crash when forwarded TCP connections fail to connect (bug
   introduced in 2015.68)

   - Avoid hang on session close when multiple sessions are started,
   affects Qt Creator
     Patch from Andrzej Szombierski

   - Reduce per-channel memory consumption in common case, increase default
     channel limit from 100 to 1000 which should improve SOCKS forwarding
   for modern
     webpages

   - Handle multiple command line arguments in a single flag, thanks to
   Guilhem Moulin

   - Manpage improvements from Guilhem Moulin

   - Build fixes for Android from Mike Frysinger

   - Don't display the MOTD when an explicit command is run from Guilhem Moulin

   - Check curve25519 shared secret isn't zero

   2015.68 - Saturday 8 August 2015

   - Reduce local data copying for improved efficiency. Measured 30%
     increase in throughput for connections to localhost

   - Forwarded TCP ports connect asynchronously and try all available addresses
     (IPv4, IPv6, round robin DNS)

   - Fix all compile warnings, many patches from Gaël Portay
     Note that configure with -Werror may not be successful on some
   platforms (OS X)
     and some configuration options may still result in unused variable
     warnings.

   - Use TCP Fast Open on Linux if available. Saves a round trip at connection
     to hosts that have previously been connected.
     Needs a recent Linux kernel and possibly "sysctl -w
   net.ipv4.tcp_fastopen=3"
     Client side is disabled by default pending further compatibility testing
     with networks and systems.

   - Increase maximum command length to 9000 bytes

   - Free memory before exiting, patch from Thorsten Horstmann. Useful for
     Dropbear ports to embedded systems and for checking memory leaks
     with valgrind. Only partially implemented for dbclient.
     This is disabled by default, enable with DROPBEAR_CLEANUP in sysoptions.h

   - DROPBEAR_DEFAULT_CLI_AUTHKEY setting now always prepends home
   directory unless
     there is a leading slash (~ isn't treated specially)

   - Fix small ECC memory leaks

   - Tighten validation of Diffie-Hellman parameters, from Florent Daigniere of
     Matta Consulting. Odds of bad values are around 2**-512 -- improbable.

   - Twofish-ctr cipher is supported though disabled by default

   - Fix pre-authentication timeout when waiting for client SSH-2.0 banner,
   thanks
     to CL Ouyang

   - Fix null pointer crash with restrictions in authorized_keys without a
   command, patch from
     Guilhem Moulin

   - Ensure authentication timeout is handled while reading the initial banner,
     thanks to CL Ouyang for finding it.

   - Fix null pointer crash when handling bad ECC keys. Found by afl-fuzz

   2015.67 - Wednesday 28 January 2015

   - Call fsync() after generating private keys to ensure they aren't lost if a
     reboot occurs. Thanks to Peter Korsgaard

   - Disable non-delayed zlib compression by default on the server. Can be
     enabled if required for old clients with DROPBEAR_SERVER_DELAY_ZLIB

   - Default client key path ~/.ssh/id_dropbear

   - Prefer stronger algorithms by default, from Fedor Brunner.
     AES256 over 3DES
     Diffie-hellman group14 over group1

   - Add option to disable CBC ciphers.

   - Disable twofish in default options.h

   - Enable sha2 HMAC algorithms by default, the code was already required
     for ECC key exchange. sha1 is the first preference still for performance.

   - Fix installing dropbear.8 in a separate build directory, from Like Ma

   - Allow configure to succeed if libtomcrypt/libtommath are missing, from
   Elan Ruusamäe

   - Don't crash if ssh-agent provides an unknown type of key. From Catalin
   Patulea

   - Minor bug fixes, a few issues found by Coverity scan

   2014.66 - Thursday 23 October 2014

   - Use the same keepalive handling behaviour as OpenSSH. This will work
   better
     with some SSH implementations that have different behaviour with unknown
     message types.

   - Don't reply with SSH_MSG_UNIMPLEMENTED when we receive a reply to our own
     keepalive message

   - Set $SSH_CLIENT to keep bash happy, patch from Ryan Cleere

   - Fix wtmp which broke since 2013.62, patch from Whoopie

   2014.65 - Friday 8 August 2014

   - Fix 2014.64 regression, server session hang on exit with scp (and probably
     others), thanks to NiLuJe for tracking it down

   - Fix 2014.64 regression, clock_gettime() error handling which broke on
   older
     Linux kernels, reported by NiLuJe

   - Fix 2014.64 regression, writev() could occassionally fail with EAGAIN
   which
     wasn't caught

   - Avoid error message when trying to set QoS on proxycommand or multihop
   pipes

   - Use /usr/bin/xauth, thanks to Mike Frysinger

   - Don't exit the client if the local user entry can't be found, thanks
   to iquaba

   2014.64 - Sunday 27 July 2014

   - Fix compiling with ECDSA and DSS disabled

   - Don't exit abruptly if too many outgoing packets are queued for
   writev(). Patch
     thanks to Ronny Meeus

   - The -K keepalive option now behaves more like OpenSSH's
   "ServerAliveInterval".
     If no response is received after 3 keepalives then the session is
   terminated. This
     will close connections faster than waiting for a TCP timeout.

   - Rework TCP priority setting. New settings are
           if (connecting || ptys || x11) tos = LOWDELAY
           else if (tcp_forwards) tos = 0
           else tos = BULK
     Thanks to Catalin Patulea for the suggestion.

   - Improve handling of many concurrent new TCP forwarded connections,
   should now
     be able to handle as many as MAX_CHANNELS. Thanks to Eduardo Silva for
   reporting
     and investigating it.

   - Make sure that exit messages from the client are printed, regression
   in 2013.57

   - Use monotonic clock where available, timeouts won't be affected by
   system time
     changes

   - Add -V for version

   2014.63 - Wednesday 19 February 2014

   - Fix ~. to terminate a client interactive session after waking a laptop
     from sleep.

   - Changed port separator syntax again, now using host^port. This is because
     IPv6 link-local addresses use %. Reported by Gui Iribarren

   - Avoid constantly relinking dropbearmulti target, fix "make install"
     for multi target, thanks to Mike Frysinger

   - Avoid getting stuck in a loop writing huge key files, reported by Bruno
     Thomsen

   - Don't link dropbearkey or dropbearconvert to libz or libutil,
     thanks to Nicolas Boos

   - Fix linking -lcrypt on systems without /usr/lib, thanks to Nicolas Boos

   - Avoid crash on exit due to cleaned up keys before last packets are sent,
     debugged by Ronald Wahl

   - Fix a race condition in rekeying where Dropbear would exit if it
   received a
     still-in-flight packet after initiating rekeying. Reported by Oliver Metz.
     This is a longstanding bug but is triggered more easily since 2013.57

   - Fix README for ecdsa keys, from Catalin Patulea

   - Ensure that generated RSA keys are always exactly the length
     requested. Previously Dropbear always generated N+16 or N+15 bit keys.
     Thanks to Unit 193

   - Fix DROPBEAR_CLI_IMMEDIATE_AUTH mode which saves a network round trip
   if the
     first public key succeeds. Still not enabled by default, needs more
     compatibility testing with other implementations.

   - Fix for port 0 forwarding in the client and port forwarding with
   Apache MINA SSHD.

   - Fix for bad system linux/pkt-sched.h header file with older Linux
   kernels, from Steve Dover

   - Fix signal handlers so that errno is saved, thanks to Erik Ahl�n for a
   patch
     and Mark Wickham for independently spotting the same problem.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Oct 14, 2021
security/dropbear: security fix

Revisions pulled up:
- security/dropbear/Makefile                                    1.32
- security/dropbear/distinfo                                    1.24
- security/dropbear/patches/patch-aa                            1.11
- security/dropbear/patches/patch-ab                            1.9
- security/dropbear/patches/patch-configure                     1.1

---
   Module Name:    pkgsrc
   Committed By:   snj
   Date:           Tue May 16 21:54:21 UTC 2017

   Modified Files:
           pkgsrc/security/dropbear: Makefile distinfo
           pkgsrc/security/dropbear/patches: patch-aa patch-ab
   Added Files:
           pkgsrc/security/dropbear/patches: patch-configure

   Log Message:
   update dropbear to 2016.74.  changes:

   2016.74 - 21 July 2016

   - Security: Message printout was vulnerable to format string injection.

     If specific usernames including "%" symbols can be created on a system
     (validated by getpwnam()) then an attacker could run arbitrary code as
   root
     when connecting to Dropbear server.

     A dbclient user who can control username or host arguments could
   potentially
     run arbitrary code as the dbclient user. This could be a problem if
   scripts
     or webpages pass untrusted input to the dbclient program.
     CVE-2016-7406
     https://secure.ucc.asn.au/hg/dropbear/rev/b66a483f3dcb

   - Security: dropbearconvert import of OpenSSH keys could run arbitrary
   code as
     the local dropbearconvert user when parsing malicious key files
     CVE-2016-7407
     https://secure.ucc.asn.au/hg/dropbear/rev/34e6127ef02e

   - Security: dbclient could run arbitrary code as the local dbclient user if
     particular -m or -c arguments are provided. This could be an issue where
     dbclient is used in scripts.
     CVE-2016-7408
     https://secure.ucc.asn.au/hg/dropbear/rev/eed9376a4ad6

   - Security: dbclient or dropbear server could expose process memory to the
     running user if compiled with DEBUG_TRACE and running with -v
     CVE-2016-7409
     https://secure.ucc.asn.au/hg/dropbear/rev/6a14b1f6dc04

     The security issues were reported by an anonymous researcher working with
     Beyond Security's SecuriTeam Secure Disclosure
   www.beyondsecurity.com/ssd.html

   - Fix port forwarding failure when connecting to domains that have both
     IPv4 and IPv6 addresses. The bug was introduced in 2015.68

   - Fix 100% CPU use while waiting for rekey to complete. Thanks to Zhang
   Hui P
     for the patch

   2016.73 - 18 March 2016

   - Support syslog in dbclient, option -o usesyslog=yes. Patch from
   Konstantin Tokarev

   - Kill a proxycommand when dbclient exits, patch from Konstantin Tokarev

   - Option to exit when a TCP forward fails, patch from Konstantin Tokarev

   - New "-o" option parsing from Konstantin Tokarev. This allows handling
   some extra options
     in the style of OpenSSH, though implementing all OpenSSH options is
   not planned.

   - Fix crash when fallback initshells() is used, reported by Michael
   Nowak and Mike Tzou

   - Allow specifying commands eg "dropbearmulti dbclient ..." instead of
   symlinks

   - Various cleanups for issues found by a lint tool, patch from Francois
   Perrad

   - Fix tab indent consistency, patch from Francois Perrad

   - Fix issues found by cppcheck, reported by Mike Tzou

   - Use system memset_s() or explicit_bzero() if available to clear
   memory. Also make
     libtomcrypt/libtommath routines use that (or Dropbear's own m_burn()).

   - Prevent scp failing when the local user doesn't exist. Based on patch
   from Michael Witten.

   - Improved Travis CI test running, thanks to Mike Tzou

   - Improve some code that was flagged by Coverity and Fortify Static Code
   Analyzer

   2016.72 - 9 March 2016

   - Validate X11 forwarding input. Could allow bypass of authorized_keys
   command= restrictions,
     found by github.com/tintinweb. Thanks for Damien Miller for a patch.
   CVE-2016-3116
     https://secure.ucc.asn.au/hg/dropbear/rev/a3e8389e01ff

   2015.71 - 3 December 2015

   - Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

   - Fix crash on exit when -p address:port is used, broke in 2015.68,
   thanks to
     Frank Stollenwerk for reporting and investigation

   - Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from
   Konstantin Tokarev

   - Fix bad configure script test which didn't work with dash shell, patch
   from Juergen Daubert,
     broke in 2015.70

   - Fix server race condition that could cause sessions to hang on exit,
     MarketSquare/SSHLibrary#128

   2015.70 - 26 November 2015

   - Fix server password authentication on Linux, broke in 2015.69

   2015.69 - 25 November 2015

   - Fix crash when forwarded TCP connections fail to connect (bug
   introduced in 2015.68)

   - Avoid hang on session close when multiple sessions are started,
   affects Qt Creator
     Patch from Andrzej Szombierski

   - Reduce per-channel memory consumption in common case, increase default
     channel limit from 100 to 1000 which should improve SOCKS forwarding
   for modern
     webpages

   - Handle multiple command line arguments in a single flag, thanks to
   Guilhem Moulin

   - Manpage improvements from Guilhem Moulin

   - Build fixes for Android from Mike Frysinger

   - Don't display the MOTD when an explicit command is run from Guilhem Moulin

   - Check curve25519 shared secret isn't zero

   2015.68 - Saturday 8 August 2015

   - Reduce local data copying for improved efficiency. Measured 30%
     increase in throughput for connections to localhost

   - Forwarded TCP ports connect asynchronously and try all available addresses
     (IPv4, IPv6, round robin DNS)

   - Fix all compile warnings, many patches from Gaël Portay
     Note that configure with -Werror may not be successful on some
   platforms (OS X)
     and some configuration options may still result in unused variable
     warnings.

   - Use TCP Fast Open on Linux if available. Saves a round trip at connection
     to hosts that have previously been connected.
     Needs a recent Linux kernel and possibly "sysctl -w
   net.ipv4.tcp_fastopen=3"
     Client side is disabled by default pending further compatibility testing
     with networks and systems.

   - Increase maximum command length to 9000 bytes

   - Free memory before exiting, patch from Thorsten Horstmann. Useful for
     Dropbear ports to embedded systems and for checking memory leaks
     with valgrind. Only partially implemented for dbclient.
     This is disabled by default, enable with DROPBEAR_CLEANUP in sysoptions.h

   - DROPBEAR_DEFAULT_CLI_AUTHKEY setting now always prepends home
   directory unless
     there is a leading slash (~ isn't treated specially)

   - Fix small ECC memory leaks

   - Tighten validation of Diffie-Hellman parameters, from Florent Daigniere of
     Matta Consulting. Odds of bad values are around 2**-512 -- improbable.

   - Twofish-ctr cipher is supported though disabled by default

   - Fix pre-authentication timeout when waiting for client SSH-2.0 banner,
   thanks
     to CL Ouyang

   - Fix null pointer crash with restrictions in authorized_keys without a
   command, patch from
     Guilhem Moulin

   - Ensure authentication timeout is handled while reading the initial banner,
     thanks to CL Ouyang for finding it.

   - Fix null pointer crash when handling bad ECC keys. Found by afl-fuzz

   2015.67 - Wednesday 28 January 2015

   - Call fsync() after generating private keys to ensure they aren't lost if a
     reboot occurs. Thanks to Peter Korsgaard

   - Disable non-delayed zlib compression by default on the server. Can be
     enabled if required for old clients with DROPBEAR_SERVER_DELAY_ZLIB

   - Default client key path ~/.ssh/id_dropbear

   - Prefer stronger algorithms by default, from Fedor Brunner.
     AES256 over 3DES
     Diffie-hellman group14 over group1

   - Add option to disable CBC ciphers.

   - Disable twofish in default options.h

   - Enable sha2 HMAC algorithms by default, the code was already required
     for ECC key exchange. sha1 is the first preference still for performance.

   - Fix installing dropbear.8 in a separate build directory, from Like Ma

   - Allow configure to succeed if libtomcrypt/libtommath are missing, from
   Elan Ruusamäe

   - Don't crash if ssh-agent provides an unknown type of key. From Catalin
   Patulea

   - Minor bug fixes, a few issues found by Coverity scan

   2014.66 - Thursday 23 October 2014

   - Use the same keepalive handling behaviour as OpenSSH. This will work
   better
     with some SSH implementations that have different behaviour with unknown
     message types.

   - Don't reply with SSH_MSG_UNIMPLEMENTED when we receive a reply to our own
     keepalive message

   - Set $SSH_CLIENT to keep bash happy, patch from Ryan Cleere

   - Fix wtmp which broke since 2013.62, patch from Whoopie

   2014.65 - Friday 8 August 2014

   - Fix 2014.64 regression, server session hang on exit with scp (and probably
     others), thanks to NiLuJe for tracking it down

   - Fix 2014.64 regression, clock_gettime() error handling which broke on
   older
     Linux kernels, reported by NiLuJe

   - Fix 2014.64 regression, writev() could occassionally fail with EAGAIN
   which
     wasn't caught

   - Avoid error message when trying to set QoS on proxycommand or multihop
   pipes

   - Use /usr/bin/xauth, thanks to Mike Frysinger

   - Don't exit the client if the local user entry can't be found, thanks
   to iquaba

   2014.64 - Sunday 27 July 2014

   - Fix compiling with ECDSA and DSS disabled

   - Don't exit abruptly if too many outgoing packets are queued for
   writev(). Patch
     thanks to Ronny Meeus

   - The -K keepalive option now behaves more like OpenSSH's
   "ServerAliveInterval".
     If no response is received after 3 keepalives then the session is
   terminated. This
     will close connections faster than waiting for a TCP timeout.

   - Rework TCP priority setting. New settings are
           if (connecting || ptys || x11) tos = LOWDELAY
           else if (tcp_forwards) tos = 0
           else tos = BULK
     Thanks to Catalin Patulea for the suggestion.

   - Improve handling of many concurrent new TCP forwarded connections,
   should now
     be able to handle as many as MAX_CHANNELS. Thanks to Eduardo Silva for
   reporting
     and investigating it.

   - Make sure that exit messages from the client are printed, regression
   in 2013.57

   - Use monotonic clock where available, timeouts won't be affected by
   system time
     changes

   - Add -V for version

   2014.63 - Wednesday 19 February 2014

   - Fix ~. to terminate a client interactive session after waking a laptop
     from sleep.

   - Changed port separator syntax again, now using host^port. This is because
     IPv6 link-local addresses use %. Reported by Gui Iribarren

   - Avoid constantly relinking dropbearmulti target, fix "make install"
     for multi target, thanks to Mike Frysinger

   - Avoid getting stuck in a loop writing huge key files, reported by Bruno
     Thomsen

   - Don't link dropbearkey or dropbearconvert to libz or libutil,
     thanks to Nicolas Boos

   - Fix linking -lcrypt on systems without /usr/lib, thanks to Nicolas Boos

   - Avoid crash on exit due to cleaned up keys before last packets are sent,
     debugged by Ronald Wahl

   - Fix a race condition in rekeying where Dropbear would exit if it
   received a
     still-in-flight packet after initiating rekeying. Reported by Oliver Metz.
     This is a longstanding bug but is triggered more easily since 2013.57

   - Fix README for ecdsa keys, from Catalin Patulea

   - Ensure that generated RSA keys are always exactly the length
     requested. Previously Dropbear always generated N+16 or N+15 bit keys.
     Thanks to Unit 193

   - Fix DROPBEAR_CLI_IMMEDIATE_AUTH mode which saves a network round trip
   if the
     first public key succeeds. Still not enabled by default, needs more
     compatibility testing with other implementations.

   - Fix for port 0 forwarding in the client and port forwarding with
   Apache MINA SSHD.

   - Fix for bad system linux/pkt-sched.h header file with older Linux
   kernels, from Steve Dover

   - Fix signal handlers so that errno is saved, thanks to Erik Ahl�n for a
   patch
     and Mark Wickham for independently spotting the same problem.
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 18, 2023
security/dropbear: security fix

Revisions pulled up:
- security/dropbear/Makefile                                    1.32
- security/dropbear/distinfo                                    1.24
- security/dropbear/patches/patch-aa                            1.11
- security/dropbear/patches/patch-ab                            1.9
- security/dropbear/patches/patch-configure                     1.1

---
   Module Name:    pkgsrc
   Committed By:   snj
   Date:           Tue May 16 21:54:21 UTC 2017

   Modified Files:
           pkgsrc/security/dropbear: Makefile distinfo
           pkgsrc/security/dropbear/patches: patch-aa patch-ab
   Added Files:
           pkgsrc/security/dropbear/patches: patch-configure

   Log Message:
   update dropbear to 2016.74.  changes:

   2016.74 - 21 July 2016

   - Security: Message printout was vulnerable to format string injection.

     If specific usernames including "%" symbols can be created on a system
     (validated by getpwnam()) then an attacker could run arbitrary code as
   root
     when connecting to Dropbear server.

     A dbclient user who can control username or host arguments could
   potentially
     run arbitrary code as the dbclient user. This could be a problem if
   scripts
     or webpages pass untrusted input to the dbclient program.
     CVE-2016-7406
     https://secure.ucc.asn.au/hg/dropbear/rev/b66a483f3dcb

   - Security: dropbearconvert import of OpenSSH keys could run arbitrary
   code as
     the local dropbearconvert user when parsing malicious key files
     CVE-2016-7407
     https://secure.ucc.asn.au/hg/dropbear/rev/34e6127ef02e

   - Security: dbclient could run arbitrary code as the local dbclient user if
     particular -m or -c arguments are provided. This could be an issue where
     dbclient is used in scripts.
     CVE-2016-7408
     https://secure.ucc.asn.au/hg/dropbear/rev/eed9376a4ad6

   - Security: dbclient or dropbear server could expose process memory to the
     running user if compiled with DEBUG_TRACE and running with -v
     CVE-2016-7409
     https://secure.ucc.asn.au/hg/dropbear/rev/6a14b1f6dc04

     The security issues were reported by an anonymous researcher working with
     Beyond Security's SecuriTeam Secure Disclosure
   www.beyondsecurity.com/ssd.html

   - Fix port forwarding failure when connecting to domains that have both
     IPv4 and IPv6 addresses. The bug was introduced in 2015.68

   - Fix 100% CPU use while waiting for rekey to complete. Thanks to Zhang
   Hui P
     for the patch

   2016.73 - 18 March 2016

   - Support syslog in dbclient, option -o usesyslog=yes. Patch from
   Konstantin Tokarev

   - Kill a proxycommand when dbclient exits, patch from Konstantin Tokarev

   - Option to exit when a TCP forward fails, patch from Konstantin Tokarev

   - New "-o" option parsing from Konstantin Tokarev. This allows handling
   some extra options
     in the style of OpenSSH, though implementing all OpenSSH options is
   not planned.

   - Fix crash when fallback initshells() is used, reported by Michael
   Nowak and Mike Tzou

   - Allow specifying commands eg "dropbearmulti dbclient ..." instead of
   symlinks

   - Various cleanups for issues found by a lint tool, patch from Francois
   Perrad

   - Fix tab indent consistency, patch from Francois Perrad

   - Fix issues found by cppcheck, reported by Mike Tzou

   - Use system memset_s() or explicit_bzero() if available to clear
   memory. Also make
     libtomcrypt/libtommath routines use that (or Dropbear's own m_burn()).

   - Prevent scp failing when the local user doesn't exist. Based on patch
   from Michael Witten.

   - Improved Travis CI test running, thanks to Mike Tzou

   - Improve some code that was flagged by Coverity and Fortify Static Code
   Analyzer

   2016.72 - 9 March 2016

   - Validate X11 forwarding input. Could allow bypass of authorized_keys
   command= restrictions,
     found by github.com/tintinweb. Thanks for Damien Miller for a patch.
   CVE-2016-3116
     https://secure.ucc.asn.au/hg/dropbear/rev/a3e8389e01ff

   2015.71 - 3 December 2015

   - Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

   - Fix crash on exit when -p address:port is used, broke in 2015.68,
   thanks to
     Frank Stollenwerk for reporting and investigation

   - Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from
   Konstantin Tokarev

   - Fix bad configure script test which didn't work with dash shell, patch
   from Juergen Daubert,
     broke in 2015.70

   - Fix server race condition that could cause sessions to hang on exit,
     MarketSquare/SSHLibrary#128

   2015.70 - 26 November 2015

   - Fix server password authentication on Linux, broke in 2015.69

   2015.69 - 25 November 2015

   - Fix crash when forwarded TCP connections fail to connect (bug
   introduced in 2015.68)

   - Avoid hang on session close when multiple sessions are started,
   affects Qt Creator
     Patch from Andrzej Szombierski

   - Reduce per-channel memory consumption in common case, increase default
     channel limit from 100 to 1000 which should improve SOCKS forwarding
   for modern
     webpages

   - Handle multiple command line arguments in a single flag, thanks to
   Guilhem Moulin

   - Manpage improvements from Guilhem Moulin

   - Build fixes for Android from Mike Frysinger

   - Don't display the MOTD when an explicit command is run from Guilhem Moulin

   - Check curve25519 shared secret isn't zero

   2015.68 - Saturday 8 August 2015

   - Reduce local data copying for improved efficiency. Measured 30%
     increase in throughput for connections to localhost

   - Forwarded TCP ports connect asynchronously and try all available addresses
     (IPv4, IPv6, round robin DNS)

   - Fix all compile warnings, many patches from Gaël Portay
     Note that configure with -Werror may not be successful on some
   platforms (OS X)
     and some configuration options may still result in unused variable
     warnings.

   - Use TCP Fast Open on Linux if available. Saves a round trip at connection
     to hosts that have previously been connected.
     Needs a recent Linux kernel and possibly "sysctl -w
   net.ipv4.tcp_fastopen=3"
     Client side is disabled by default pending further compatibility testing
     with networks and systems.

   - Increase maximum command length to 9000 bytes

   - Free memory before exiting, patch from Thorsten Horstmann. Useful for
     Dropbear ports to embedded systems and for checking memory leaks
     with valgrind. Only partially implemented for dbclient.
     This is disabled by default, enable with DROPBEAR_CLEANUP in sysoptions.h

   - DROPBEAR_DEFAULT_CLI_AUTHKEY setting now always prepends home
   directory unless
     there is a leading slash (~ isn't treated specially)

   - Fix small ECC memory leaks

   - Tighten validation of Diffie-Hellman parameters, from Florent Daigniere of
     Matta Consulting. Odds of bad values are around 2**-512 -- improbable.

   - Twofish-ctr cipher is supported though disabled by default

   - Fix pre-authentication timeout when waiting for client SSH-2.0 banner,
   thanks
     to CL Ouyang

   - Fix null pointer crash with restrictions in authorized_keys without a
   command, patch from
     Guilhem Moulin

   - Ensure authentication timeout is handled while reading the initial banner,
     thanks to CL Ouyang for finding it.

   - Fix null pointer crash when handling bad ECC keys. Found by afl-fuzz

   2015.67 - Wednesday 28 January 2015

   - Call fsync() after generating private keys to ensure they aren't lost if a
     reboot occurs. Thanks to Peter Korsgaard

   - Disable non-delayed zlib compression by default on the server. Can be
     enabled if required for old clients with DROPBEAR_SERVER_DELAY_ZLIB

   - Default client key path ~/.ssh/id_dropbear

   - Prefer stronger algorithms by default, from Fedor Brunner.
     AES256 over 3DES
     Diffie-hellman group14 over group1

   - Add option to disable CBC ciphers.

   - Disable twofish in default options.h

   - Enable sha2 HMAC algorithms by default, the code was already required
     for ECC key exchange. sha1 is the first preference still for performance.

   - Fix installing dropbear.8 in a separate build directory, from Like Ma

   - Allow configure to succeed if libtomcrypt/libtommath are missing, from
   Elan Ruusamäe

   - Don't crash if ssh-agent provides an unknown type of key. From Catalin
   Patulea

   - Minor bug fixes, a few issues found by Coverity scan

   2014.66 - Thursday 23 October 2014

   - Use the same keepalive handling behaviour as OpenSSH. This will work
   better
     with some SSH implementations that have different behaviour with unknown
     message types.

   - Don't reply with SSH_MSG_UNIMPLEMENTED when we receive a reply to our own
     keepalive message

   - Set $SSH_CLIENT to keep bash happy, patch from Ryan Cleere

   - Fix wtmp which broke since 2013.62, patch from Whoopie

   2014.65 - Friday 8 August 2014

   - Fix 2014.64 regression, server session hang on exit with scp (and probably
     others), thanks to NiLuJe for tracking it down

   - Fix 2014.64 regression, clock_gettime() error handling which broke on
   older
     Linux kernels, reported by NiLuJe

   - Fix 2014.64 regression, writev() could occassionally fail with EAGAIN
   which
     wasn't caught

   - Avoid error message when trying to set QoS on proxycommand or multihop
   pipes

   - Use /usr/bin/xauth, thanks to Mike Frysinger

   - Don't exit the client if the local user entry can't be found, thanks
   to iquaba

   2014.64 - Sunday 27 July 2014

   - Fix compiling with ECDSA and DSS disabled

   - Don't exit abruptly if too many outgoing packets are queued for
   writev(). Patch
     thanks to Ronny Meeus

   - The -K keepalive option now behaves more like OpenSSH's
   "ServerAliveInterval".
     If no response is received after 3 keepalives then the session is
   terminated. This
     will close connections faster than waiting for a TCP timeout.

   - Rework TCP priority setting. New settings are
           if (connecting || ptys || x11) tos = LOWDELAY
           else if (tcp_forwards) tos = 0
           else tos = BULK
     Thanks to Catalin Patulea for the suggestion.

   - Improve handling of many concurrent new TCP forwarded connections,
   should now
     be able to handle as many as MAX_CHANNELS. Thanks to Eduardo Silva for
   reporting
     and investigating it.

   - Make sure that exit messages from the client are printed, regression
   in 2013.57

   - Use monotonic clock where available, timeouts won't be affected by
   system time
     changes

   - Add -V for version

   2014.63 - Wednesday 19 February 2014

   - Fix ~. to terminate a client interactive session after waking a laptop
     from sleep.

   - Changed port separator syntax again, now using host^port. This is because
     IPv6 link-local addresses use %. Reported by Gui Iribarren

   - Avoid constantly relinking dropbearmulti target, fix "make install"
     for multi target, thanks to Mike Frysinger

   - Avoid getting stuck in a loop writing huge key files, reported by Bruno
     Thomsen

   - Don't link dropbearkey or dropbearconvert to libz or libutil,
     thanks to Nicolas Boos

   - Fix linking -lcrypt on systems without /usr/lib, thanks to Nicolas Boos

   - Avoid crash on exit due to cleaned up keys before last packets are sent,
     debugged by Ronald Wahl

   - Fix a race condition in rekeying where Dropbear would exit if it
   received a
     still-in-flight packet after initiating rekeying. Reported by Oliver Metz.
     This is a longstanding bug but is triggered more easily since 2013.57

   - Fix README for ecdsa keys, from Catalin Patulea

   - Ensure that generated RSA keys are always exactly the length
     requested. Previously Dropbear always generated N+16 or N+15 bit keys.
     Thanks to Unit 193

   - Fix DROPBEAR_CLI_IMMEDIATE_AUTH mode which saves a network round trip
   if the
     first public key succeeds. Still not enabled by default, needs more
     compatibility testing with other implementations.

   - Fix for port 0 forwarding in the client and port forwarding with
   Apache MINA SSHD.

   - Fix for bad system linux/pkt-sched.h header file with older Linux
   kernels, from Steve Dover

   - Fix signal handlers so that errno is saved, thanks to Erik Ahl�n for a
   patch
     and Mark Wickham for independently spotting the same problem.
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
2015.71 - 3 December 2015

- Fix "bad buf_incrpos" when data is transferred, broke in 2015.69

- Fix crash on exit when -p address:port is used, broke in 2015.68

- Fix building with only ENABLE_CLI_REMOTETCPFWD given, patch from Konstantin Tokarev

- Fix bad configure script test which didn't work with dash shell, patch from Juergen Daubert,
  broke in 2015.70

- Fix server race condition that could cause sessions to hang on exit,
  MarketSquare/SSHLibrary#128

(From OE-Core rev: d0658e0e9efcf2c995e92a61af0e5300ebcdce82)

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants