The DHCP vulnerabilities in embedded firmware that matter most as of 2026-11-17 sit in option parsing and in the scripts that act on options: BusyBox udhcp (CVE-2018-20679, CVE-2019-5747), dhcpcd (CVE-2019-11577), ISC DHCP (CVE-2021-25217), the dhclient script injection CVE-2018-1111, and TunnelVision (CVE-2024-3661), which abuses option 121 routes. Any host on the same network segment can send those packets before any login. Identify which client and server the image runs, upgrade or backport, validate and quote every option in hook scripts, and test the client against a hostile server.
Key takeaways
- DHCP option parsing is pre-auth attack surface because a device that boots with DHCP takes its configuration from whoever answers first, and it parses that answer before anything is authenticated.
- Most devices carry one client for the WAN or uplink and, if they route, one server for the LAN.
- Six records cover most of what a scan of a DHCP-capable image turns up, and the version alone settles only some of them.
- Hook scripts turn options into a root shell when a value from the packet is evaluated as shell code instead of being treated as data.
Why is DHCP option parsing a pre-auth attack surface on every device?
DHCP option parsing is pre-auth attack surface because a device that boots with DHCP takes its configuration from whoever answers first, and it parses that answer before anything is authenticated. The protocol was designed that way. RFC 2131's security section calls DHCP "quite insecure" in its base form and warns that "unauthorized DHCP servers may be easily set up" and can send "incorrect routing information" and "spoof nameservers". The client cannot tell a rogue reply from a real one.
Two pieces of code then handle attacker-chosen bytes:
- The option parser. A DHCPv4 reply carries options as type, length and value; DHCPv6 nests options inside options. The C code that walks them must check every length against the packet and against the size the option is supposed to have. CVE-2018-20679 and CVE-2019-5747 in BusyBox are exactly that check missing.
- The hook script. Most embedded clients do not configure the interface themselves. They export the options as environment variables and run a shell script as root, so a host name, domain or boot file name chosen by the attacker reaches a shell. CVE-2018-1111 is that path going wrong.
On the server side the exposure runs the other way: a router's DHCP server parses requests from every client on the LAN, including host names that later appear in its admin pages. Our input handling in embedded firmware guide covers that second-order case.
Which DHCP clients and servers ship in embedded firmware?
Most devices carry one client for the WAN or uplink and, if they route, one server for the LAN. The common combinations come from the build system. OpenWrt's default router package set lists dnsmasq, odhcp6c and odhcpd-ipv6only, and its netifd DHCP protocol handler runs BusyBox udhcpc as the DHCPv4 client. Buildroot offers more choice: its ISC DHCP package still builds 4.4.3-P1, and its dhcpcd package builds 10.5.2 as of 2026-11-17.
| Component | Role | Where it ships | How the version shows |
|---|---|---|---|
BusyBox udhcpc, udhcpc6, udhcpd, dhcprelay |
DHCPv4/v6 client, small server, relay | Almost every BusyBox-based image; the OpenWrt WAN client | The BusyBox version of the one executable |
| dhcpcd | DHCPv4/v6 client with IPv4LL and router solicitation | Buildroot and Yocto images, general embedded Linux | dhcpcd --version, binary strings, package record |
ISC DHCP (dhclient, dhcpd, dhcrelay) |
Client, server, relay | Older Linux-based appliances, industrial gateways, Buildroot | dhcpd --version, strings such as isc-dhcp-4.4.3-P1 |
Kea (kea-dhcp4, kea-dhcp6) |
Server only | Larger gateways and appliances that need a managed server | kea-dhcp4 -v, package record |
| dnsmasq | DHCPv4/v6 server and DNS forwarder | Most home and small-office routers | dnsmasq --version, strings dnsmasq-2.xx |
| odhcpd | DHCPv6 and router advertisement server; full build adds DHCPv4 | OpenWrt and its derivatives | Source date and commit in the package version |
| odhcp6c | DHCPv6 client | OpenWrt WAN side | Source date and commit in the package version |
Two points matter for an SBOM. BusyBox's DHCP code is part of the busybox component, so a udhcp CVE attaches to that one line; our BusyBox vulnerabilities guide explains how to tell whether the applet is built in. And OpenWrt's odhcpd Makefile pins a git commit and a PKG_SOURCE_DATE of 2026-10-28, not a release number, so version matching against CVE ranges does not work for odhcpd or odhcp6c; you compare commits instead. dnsmasq's DHCP role has its own CVE history, covered in our dnsmasq vulnerabilities guide, so this page does not repeat it.
Which DHCP CVEs matter most for device makers?
Six records cover most of what a scan of a DHCP-capable image turns up, and the version alone settles only some of them. Scores are NVD's unless stated; EPSS values are FIRST's for 2026-11-16, and KEV status is from CISA's catalog version 2026.11.13, where none of these appears.
| CVE | Component | What it is | Affected | Fixed | CVSS | EPSS |
|---|---|---|---|---|---|---|
| CVE-2018-20679 | BusyBox udhcp | Out-of-bounds read: 4-byte options not checked to be 4 bytes; leaks stack memory | Before 1.30.0 | 1.30.0, then completed by the CVE-2019-5747 fix | 7.5 | 0.077 |
| CVE-2019-5747 | BusyBox udhcpc | Out-of-bounds read on the subnet mask option; incomplete fix for CVE-2018-20679 | Through 1.30.0 in NVD; 1.30.1 also lacks the fix | 1.31.0 (10 June 2019) | 7.5 | 0.047 |
| CVE-2019-11577 | dhcpcd | Buffer overflow reading DHCPv6 NA/TA addresses in dhcp6_findna |
Before 7.2.1 | 7.2.1 (April 2019) | 9.8 | 0.531 |
| CVE-2021-25217 | ISC DHCP dhclient and dhcpd | Buffer overrun when a stored lease with crafted encapsulated options is read back | 4.1-ESV-R1 to R16, 4.4.0 to 4.4.2; 4.0.x and 4.3.x also contain the defect | 4.1-ESV-R16-P1, 4.4.2-P1 (26 May 2021) | ISC 7.4 client, 6.5 server; NVD 7.4 | 0.061 |
| CVE-2018-1111 | Red Hat dhclient NetworkManager hook script | Command injection as root from a crafted DHCP reply | RHEL 6 and 7, Fedora 28 and earlier | RHSA-2018:1453 and RHSA-2018:1454 | 7.5 | 0.979 |
| CVE-2024-3661 (TunnelVision) | Any client that installs option 121 routes, with a route-based VPN | Injected routes steer traffic outside the VPN tunnel | Behaviour of the protocol; NVD lists VPN clients | No single fix; mitigate in the VPN design | 7.6 | 0.041 |
The BusyBox row needs care. NVD's range ends at 1.30.0, but the fix, commit 74d9f1b ("udhcpc: when decoding DHCP_SUBNET, ensure it is 4 bytes long"), went to the development branch, and the 1.30.1 stable release of 14 February 2019 still decodes the option without the length check. The BusyBox news page lists the fix in the 1.31.0 changes, so treat 1.31.0 as the first fixed release unless the vendor backported the commit.
ISC's advisory for CVE-2021-25217 is the one where architecture decides impact. ISC could not reproduce a dhclient crash on 64-bit systems, but on 32-bit builds dhclient can crash when reading the bad lease, and a 32-bit dhcpd built with -fstack-protection-strong may exit; in every case the offending lease and the one after it may be deleted. Many embedded targets are 32-bit, which is where the worse outcomes land. NVD's configuration for this record also lists Siemens RUGGEDCOM ROX firmware before 2.15.0, a reminder that industrial network gear carries ISC DHCP too.
The EPSS spread is also telling. CVE-2018-1111 sits near the top of the EPSS range, and NVD's references include public exploits for it, while the parser bugs score lower. Our KEV and EPSS prioritisation guide explains how to weigh the two signals.
How do DHCP hook scripts turn an option into a root shell?
Hook scripts turn options into a root shell when a value from the packet is evaluated as shell code instead of being treated as data. Red Hat's write-up of CVE-2018-1111 describes the pattern: a script that dhclient installed for NetworkManager "is executed each time NetworkManager receives a DHCP response", and "a malicious DHCP response could cause the script to execute arbitrary shell commands with root privileges". Red Hat rated it Critical; the parser was fine, the script was not.
Device firmware has the same structure. BusyBox udhcpc exports options such as $ip, $mask, $router, $dns, $domain, $hostname, $bootfile and $staticroutes and runs a script, by default /usr/share/udhcpc/default.script, or whatever the vendor passes with -s. BusyBox offers one guard. Its build option FEATURE_UDHCPC_SANITIZEOPT, on by default per the udhcp Config.src, replaces host and domain names that "start with dash or contain spaces" with the string bad. It applies only to options marked as host names in the option table, such as options 12 and 15; the root path (17), boot file (67) and WPAD URL (252) are passed through as plain strings. A vendor who disables the guard, or reads any other string option, has to validate it in the script.
The script below shows the safe shape: each value is validated against what it should be, always quoted, and never passed to eval, sh -c or a string that is later executed.
#!/bin/sh
# udhcpc hook: every variable below comes from a DHCP packet.
valid_ipv4() {
case "$1" in
''|*[!0-9.]*) return 1 ;;
esac
return 0
}
case "$1" in
bound|renew)
valid_ipv4 "$ip" || exit 1
case "$mask" in ''|*[!0-9]*) mask=24 ;; esac
ip addr flush dev "$interface"
ip addr add "$ip/$mask" dev "$interface"
for r in $router; do
valid_ipv4 "$r" && ip route replace default via "$r" dev "$interface" && break
done
: > /tmp/resolv.conf.dhcp
for d in $dns; do
valid_ipv4 "$d" && echo "nameserver $d" >> /tmp/resolv.conf.dhcp
done
;;
esac
The same rule holds in C: a daemon that builds a command with sprintf from an option value and hands it to system() has the CVE-2018-1111 bug without any script. Our command injection in embedded firmware guide covers the fix patterns, and our memory corruption guide covers the length checks that the parser CVEs above were missing.
What is TunnelVision (CVE-2024-3661) and does it affect devices?
TunnelVision is a way to pull traffic out of a VPN tunnel by pushing routes through DHCP option 121, and it affects any device that runs a route-based VPN client over a DHCP-configured link. Leviathan Security Group's research page explains that an attacker on the same local network can "manipulate these routing rules, diverting traffic away from the VPN", so the user still appears connected. The researchers say they saw no exploitation in the wild as of 6 May 2024, believe the technique was possible "as far back as 2002", and note that it is not completely patchable "besides on Linux".
The option itself works as specified. RFC 3442 defines option 121, says a client that receives it "MUST ignore the Router option", and warns in its own security section that it "can be used to misdirect network traffic". Embedded clients honour it: OpenWrt's netifd requests option 121 "by default", per a comment in its handler, unless the interface sets classlessroute to 0, and BusyBox udhcpc exports the routes as $staticroutes for the script to install.
On devices this matters for remote-access gateways, routers with a WireGuard or OpenVPN client, and field units that send telemetry through a tunnel. Mitigations, in order of strength:
Bind the tunnel traffic by policy, not by routeFirewall rules that drop any traffic for tunnel destinations leaving the physical interface stop the leak, although Leviathan points out that such a block still lets an attacker learn the destination and amount of traffic. Do not request option 121 where it is not neededA WAN uplink to an ISP rarely needs classless static routes; turn the request off in the client configuration. Ignore routes for tunnel prefixesIf the script installs $staticroutes, refuse routes that overlap the VPN's address space or the default route.
How do you identify the DHCP client, server and version in a firmware image?
Establish which DHCP code is present, which one starts, and what it runs on each event, because the CVEs above depend on all three.
Find the binariesIn the unpacked root file system, look for udhcpc,udhcpc6andudhcpdlinks pointing atbusybox, and for separatedhcpcd,dhclient,dhcpd,dhcrelay,kea-dhcp4,kea-dhcp6,odhcpdandodhcp6cexecutables.Read the versionsBusyBox prints its version in its banner and in the binary's strings; dhcpcd and the ISC programs carry theirs in strings too, and the package database or build manifest records the same. For odhcpd and odhcp6c, record the commit from the package version and compare it with the upstream history. Check what is compiled inFor BusyBox, the applet list shows whether udhcpc6orudhcpdexists, and a build configuration, if shipped, showsFEATURE_UDHCPC_SANITIZEOPT. For dhcpcd, the configure script enables privilege separation unless the build passes--disable-privsep, so check the build log or the presence of a dedicateddhcpcduser.Find what startsRead the init scripts, the network manager configuration (netifd's UCI files on OpenWrt) and any vendor daemon that spawns a client. Note the -sscript path for udhcpc and the hook directory for dhcpcd or dhclient.Read every hook scriptLook for eval,sh -c, backticks, unquoted variables and writes of option values into files that another script later sources. Check C daemons that read leases forsystem()andpopen()calls.Check the vendor patch listDistribution and vendor backports change the answer: a BusyBox 1.30.1 with commit 74d9f1b applied is fixed for CVE-2019-5747, whatever its version says. Our firmware diffing guide shows how to confirm a backport landed in the binary.
How should a device maker patch and configure DHCP handling?
Patch to a maintained release first, then reduce what the client accepts and what the server exposes.
Move off ISC DHCPISC's end-of-life notice states that 4.4.3-P1 and 4.1-ESV-R16-P2, released on October 5, 2022, are "the last maintenance versions", and ISC's DHCP page says its client and relay "should not be used in production any longer". Use Kea for the server role and dhcpcd or BusyBox udhcpc for the client. Keep Kea current and its API closedISC's Kea page lists 3.2.1 and 3.0.5 as current stable on 2026-11-17. Kea's notable 2025 issue was local, not on the wire: CVE-2025-32801 let a local user with access to an unsecured API make Kea load a malicious hook library, fixed in 2.4.2, 2.6.3 and 2.7.9. Require authentication on the control agent and keep control sockets in a directory only Kea can write. Update BusyBox and dhcpcdBusyBox 1.31.0 or later closes both udhcp reads. The BusyBox news page labels 1.36.1 of 19 May 2023 as the newest stable release and lists "udhcpc6: fix buffer overflow" among the changes in 1.38.0 of 13 May 2026, so a device that uses udhcpc6should take that fix as a backport or move to 1.38.0. For dhcpcd, the CVE-2019-11577 fix "only copy[s] upto the size of the address option rather than the option length"; the release list shows 10.5.2 of 17 August 2026 as the newest.Keep privilege separation ondhcpcd's privilege separation is on by default; do not turn it off to save space. For udhcpc, keep the hook script minimal, since it runs as root. Request only the options you useDrop option 121 where no static routes are expected, and ignore boot file, root path and WPAD options on devices that do not network-boot. Expose the server only where it belongsBind udhcpd, dnsmasq, odhcpd or Kea to LAN interfaces only, and block UDP ports 67 and 547 from the WAN in the device firewall. Document the resultRegenerate the SBOM and state per CVE whether the product is affected; our CSAF and VEX for device makers guide shows the format, for example "not affected" for CVE-2021-25217 on an image without ISC DHCP.
How do you test a device's DHCP handling?
Test the client against a server you control on an isolated network, because that is the attacker's position. Put the device on a lab switch with a test host that runs a scripted DHCP server, for example built with a packet-crafting library such as Scapy, and no other DHCP source.
- Malformed lengths. Send each option with a length one shorter and one longer than its type allows, including the subnet mask, router and static route options, and nested DHCPv6 options with lengths that run past the parent. Watch for crashes, restarts or a client that stops renewing.
- Shell metacharacters. Put
;,$(…), backticks, quotes, newlines and a leading-into host name, domain, boot file, root path and WPAD options, then check the hook script's actions and the system log. - Routes. Offer option 121 routes for the default route and for the VPN's prefixes, and confirm that tunnel traffic does not leave the physical interface.
- Server side. From a LAN client, send requests with oversized client IDs and host names full of HTML and shell characters, then look at the lease file and every admin page that shows client names.
- Regression. Keep the packet set as a test suite and rerun it on each firmware build, including after a BusyBox or dhcpcd update.
Worked example: how would you triage DHCP in a cellular gateway image?
Synthetic example, not a real product. A gateway maker scans a Buildroot-based image for a 32-bit ARM cellular router with an Ethernet WAN port and a WireGuard tunnel to the maker's cloud.
InventoryBusyBox 1.30.1 provides udhcpcfor the Ethernet WAN; ISC DHCP 4.4.2 providesdhcpdon the LAN; no dhcpcd, Kea or dnsmasq.MatchCVE-2019-5747 applies: 1.30.1 lacks the length check and the vendor patch list shows no backport, even though NVD's range ends at 1.30.0. CVE-2018-20679 does not, fixed in 1.30.0. CVE-2021-25217 applies to the 4.4.2 dhcpd, and on a 32-bit build a crafted lease can stop LAN service.Read the scriptsThe udhcpc hook writes $domaininto a file that another script later runs with.; the sanitize option is on, so spaces are filtered, but other shell characters are not, and the hook must change.Check routesThe client requests option 121 and installs $staticrouteswithout filtering, and WireGuard traffic is routed, not bound by firewall rules, so TunnelVision applies.FixShip BusyBox 1.36.1 or later, replace ISC dhcpdwith Kea or dnsmasq, rewrite the hook to validate and quote values, stop requesting option 121, add a firewall rule that drops tunnel-bound traffic on the WAN interface, then re-scan, rerun the lab tests and publish a VEX statement per CVE.
How does AI-assisted analysis help with DHCP findings?
SoftWSP's automated scan unpacks a firmware image, catalogs the software packages in the extracted file system with their versions (the inventory our firmware SBOM guide describes), and matches each one against CVE records, CISA's KEV catalog and FIRST's EPSS scores. This is deterministic code: the code scores, and AI narrates. You can inspect the resulting CycloneDX file in the free SBOM viewer.
Version matching inherits NVD's ranges and their limits, which are visible in this topic. BusyBox and dnsmasq package names are mapped to the identifiers NVD files their CVEs under; for dhcpcd, ISC DHCP and Kea the match depends on the identifier the SBOM generator assigns, and odhcpd and odhcp6c have no release versions to match at all. A version also cannot show whether udhcpc6 is compiled in, what a hook script does with $domain, whether option 121 is requested or whether a vendor backported commit 74d9f1b. AI's part is the written explanation of what matched, citing the component, version and record behind each sentence, and an engineer reviews every finding, including those questions, before the report goes out.
For other network daemons on the same devices, see our hostapd and wpa_supplicant and OpenSSH guides, or device & firmware security services to have a specific image reviewed.
This guide draws on RFC 2131 and RFC 3442, ISC's advisories for CVE-2021-25217 and CVE-2025-32801, its ISC DHCP end-of-life notice and Kea page, Red Hat's CVE-2018-1111 write-up, dhcpcd's commit history, release list and configure script, BusyBox's news page, commit 74d9f1b and udhcp source, Leviathan Security Group's TunnelVision page, the OpenWrt and Buildroot package files, NVD, CISA's KEV catalog (version 2026.11.13) and FIRST EPSS data dated 2026-11-16, all read directly on 2026-11-17.
Put this guide to work
Frequently asked questions
Why are DHCP clients a remote attack surface on embedded devices?
A device that gets its address by DHCP accepts configuration from whoever answers its broadcast first, before any login or key exchange. RFC 2131 says unauthorized DHCP servers "may be easily set up" and can hand out false routers and name servers. Every option in the reply, from the subnet mask to host names, boot file names and static routes, is parsed by the client's C code and is then often passed to a shell script running as root. A bug in either step can be triggered by any host on the same network segment.
Which DHCP vulnerabilities matter most for device makers?
As of 2026-11-17, check BusyBox udhcp for CVE-2018-20679 and CVE-2019-5747, two out-of-bounds reads on crafted options fixed fully only in BusyBox 1.31.0; dhcpcd for CVE-2019-11577, a DHCPv6 buffer overflow fixed in 7.2.1; and ISC DHCP for CVE-2021-25217, a lease-file buffer overrun fixed in 4.4.2-P1 and 4.1-ESV-R16-P1. CVE-2018-1111 shows the script-hook risk: a root command injection in Red Hat's dhclient NetworkManager script. TunnelVision (CVE-2024-3661) matters for any device that runs a VPN client over a DHCP-configured link. None of these is in CISA's KEV catalog.
How do I find which DHCP client and server a firmware image uses?
Unpack the root file system and look for the binaries and their links: udhcpc and udhcpd are applets inside the BusyBox executable, while dhcpcd, dhclient, dhcpd, the kea-dhcp4 and kea-dhcp6 daemons, odhcpd and odhcp6c are separate files. Then read the init scripts or network manager configuration to see which one actually starts, and with which hook script. Versions come from the BusyBox banner string, from dhcpcd --version or the binary's strings, and from the package database or build manifest; OpenWrt's odhcpd and odhcp6c are versioned by source date and commit, not by release numbers.
Is ISC DHCP still safe to ship in new firmware?
ISC ended maintenance of ISC DHCP: the 4.4.3-P1 and 4.1-ESV-R16-P2 releases of October 5, 2022 are the last maintenance versions, and ISC says its client and relay are no longer maintained and should not be used in production. A server that already ships can keep running on an isolated network, but new designs should use Kea for the server role and a maintained client such as dhcpcd or BusyBox udhcpc. Kea is server only: ISC states that the Kea distribution includes neither a client nor a relay.
Does SoftWSP detect DHCP components in my firmware?
SoftWSP's automated scan catalogs the software packages in an unpacked firmware file system with their versions and matches them against CVE records, CISA's KEV catalog and FIRST EPSS scores. BusyBox and dnsmasq package names are mapped to the identifiers NVD files their CVEs under; for other DHCP packages the match depends on the identifier the SBOM generator assigns. AI then writes a plain-language summary that cites the component, version and record behind each finding, and an engineer reviews it, including which DHCP code is built in, which hook scripts run and whether a backport closes a matched CVE.
Sources
- RFC 2131: Dynamic Host Configuration Protocol (Section 7, Security Considerations)
- RFC 3442: The Classless Static Route Option for DHCPv4
- ISC: CVE-2021-25217, a buffer overrun in lease file parsing code (dhcpd and dhclient)
- ISC: ISC DHCP Server has reached EOL
- ISC: ISC DHCP (end of maintenance, client and relay status)
- ISC: Kea DHCP
- ISC: CVE-2025-32801, loading a malicious hook library can lead to local privilege escalation (Kea)
- Red Hat: DHCP Client Script Code Execution Vulnerability, CVE-2018-1111
- dhcpcd: commit 8d11b33, DHCPv6 fix for a potential buffer overflow reading NA/TA addresses (CVE-2019-11577)
- dhcpcd: release list
- dhcpcd: configure script (privilege separation build option)
- BusyBox: news and release announcements
- BusyBox: commit 74d9f1b, udhcpc DHCP_SUBNET length check (CVE-2019-5747)
- BusyBox: udhcp Config.src (FEATURE_UDHCPC_SANITIZEOPT)
- BusyBox: udhcp option table, common.c
- Leviathan Security Group: TunnelVision (CVE-2024-3661), decloaking route-based VPNs
- OpenWrt: default package set (include/target.mk)
- OpenWrt: netifd DHCP protocol handler (proto/dhcp.sh)
- OpenWrt: odhcpd package Makefile
- Buildroot: ISC DHCP package (dhcp.mk)
- Buildroot: dhcpcd package (dhcpcd.mk)
- NIST NVD: CVE-2019-5747
- NIST NVD: CVE-2019-11577
- NIST NVD: CVE-2021-25217
- NIST NVD: CVE-2018-1111
- NIST NVD: CVE-2024-3661
- CISA: Known Exploited Vulnerabilities (KEV) Catalog
About this guide
SoftWSP Firmware Security Desk
Covers the Firmware vulnerabilities & fixes cluster: 129 guides.

In this cluster
Questions about this page?
