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 (74.125.232.240) 56(84) bytes of data.
64 bytes from arn06s07-in-f16.1e100.net (74.125.232.240): 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/dhcpcd
it looks like the script path is hard-coded.