Source: http://lcamtuf.blogspot.com/2014/09/quick-notes-about-bash-bug-its-impact.html

For the same reason, userland DHCP clients that invoke configuration scripts and use variables to pass down config details are at risk when exposed to rogue servers (e.g., on open wifi).

Wonder if Linux dhclient is vulnerable to config details passed from the router.

If so, many desktop Linux rigs should be patched ASAP. Also interested in DHCP configuration done in Android.



The dhclient-script network-configuration shell script is run during the DHCP process, and a number of parameters from the server (such as domain-name) are passed to it in environment variables. The script is set to be interpreted by /bin/sh, so if your system has that symlinked to /bin/bash (which is quite common), you're vulnerable.

What's more, on Debian (and possibly many of its myriads of offsprings like Ubuntu), which uses dash as /bin/sh, dhclient-script is explicitely shebanged to /bin/bash, and it does seem to contain a bashism, too.

  • 2
    So Mac OS X should be vulnerable, too. What about Android? – Deer Hunter Sep 25 '14 at 10:08
  • I don't know. Android mostly doesn't use the GNU userland programs, so it may use a different DHCP client, or it may not have bash. – Mark Sep 25 '14 at 10:10
  • See blog.varunkumar.me/2010/09/… – Deer Hunter Sep 25 '14 at 10:12
  • 4
    Android uses a variant of ash or ksh, depending on the version. Neither of those are vulnerable. stackoverflow.com/questions/11950131/… – sep332 Sep 25 '14 at 13:57
  • 1
    @sep332 your comment is worth converting to an answer or an answer to a separate question. – Smit Johnth Sep 25 '14 at 17:15

Both dhclient and dhcpcd call configuration scripts that invoke a system shell, so they are vulnerable.

However, based on my testing it looks like you can run at least dhcpcd successfully without the config script (if you rename/move the script):

$ pkill dhcpcd
$ ping -c 1 www.google.com
ping: unknown host www.google.com

$ mv /usr/lib/dhcpcd/dhcpcd-run-hooks /usr/lib/dhcpcd/dhcpcd-run-hooks-disabled
$ dhcpcd
dhcpcd[29057]: version 6.4.3 starting
dhcpcd[29057]: script_runreason: /usr/lib/dhcpcd/dhcpcd-run-hooks: WEXITSTATUS 127
dhcpcd[29057]: forked to background, child pid 29069

$ ping -c 1 www.google.com
PING www.google.com ( 56(84) bytes of data.
64 bytes from arn06s07-in-f16.1e100.net ( icmp_seq=1 ttl=54 time=16.4 ms

As you can see, there is a warning, but in the end the connection is established.

There will probably be some things (e.g. domain) that are not set correctly, so this is a hackish solution. I have not tested this on a WiFi network, it could fail there.

Edit: based on strings /usr/bin/dhcpcdit looks like the script path is hard-coded.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.