<div dir="ltr"><div><div>I know this could be found in the code, and my own systems have busybox not bash, but I thought I'd ask for general interest:<br><br>Is this a matter only of the shebang line in the script, or does dnsmasq use `system()` to run it, meaning that control passes through the user's login shell before transferring to the interpreter listed in the shebang?<br><br></div>If the script is execed or spawned, then changing the shebang to /bin/ash or other non-bash implementation which aims for bash compatibility could be an even faster workaround (that also cures aftershock).<br><br></div>BTW, isn't that script executed as root only in --leasefile-ro mode, and that without remote input in the environment?  Oh nevermind, the script always gets invoked from the dnsmasq process that doesn't drop privilege, unless that new --dhcp-scriptuser option is active.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 26, 2014 at 4:14 PM, Simon Kelley <span dir="ltr"><<a href="mailto:simon@thekelleys.org.uk" target="_blank">simon@thekelleys.org.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is just a heads-up that if you're using the --dhcp-script option in<br>
dnsmasq, and the script you're calling is being interpreted by bash,<br>
then you're affected by the shellshock bug.<br>
<br>
The bug allows execution of arbitrary code contained in the values of<br>
environment variables, and there are several variables in the<br>
environment inherited by the DHCP script whose values can be set<br>
directly by a DHCP client, so any DHCP client on your network (or<br>
elsewhere, if your firewall allows) can execute arbitrary shellcode,<br>
probably as root, with a simple DHCP request.<br>
<br>
The fix, of course, is to update bash.<br>
<br>
<br>
Cheers,<br>
<br>
Simon.<br>
<br>
_______________________________________________<br>
Dnsmasq-discuss mailing list<br>
<a href="mailto:Dnsmasq-discuss@lists.thekelleys.org.uk">Dnsmasq-discuss@lists.thekelleys.org.uk</a><br>
<a href="http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss" target="_blank">http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss</a><br>
</blockquote></div><br></div>