A Short IPv4 Frame Could Panic insomniacslk/dhcp
GHSA-jp3c-6v3g-mpxv covers a denial-of-service flaw in the Go package github.com/insomniacslk/dhcp. In dhcpv4/nclient4, BroadcastRawUDPConn.ReadFrom calculates the DHCP payload length before confirming that the IPv4 packet is large enough to contain a UDP header.
An IPv4 total-length value that leaves fewer than eight payload bytes produces a negative DHCP length. The packet then reaches buf.Consume with a negative slice bound and triggers a panic. The advisory assigns a CVSS v4 score of 7.1 with an adjacent attack vector, no privileges, and no user interaction. Availability is the only impacted category in the published vector.
The bug is not a remote shell. It is the kind of failure that can still take a process out of service repeatedly. Code that parses DHCP traffic often runs in network controllers, provisioning services, test harnesses, and appliance agents. A malformed packet from a neighboring network may be enough to crash the component if no outer process isolation or recovery boundary exists.
The fixed pseudo-version is 0.0.0-20260719225207-c76316d4aa82. Teams should pin or update the Go module and rebuild every binary that includes the DHCP client code. Checking go list -m all is a useful start, but the final inventory should map the vulnerable module to deployed services, container images, and vendored builds. A source repository can be fixed while an old image remains live.
Defensive code should reject an IPv4 packet before subtraction when the payload cannot hold the protocol header. After the fix, add a regression test with total-length values 0 through 8 and confirm that malformed input returns an error instead of reaching a panic. Consider running packet parsers in a process that can restart independently of the management API.
If the parser is part of a DHCP service, monitor for abrupt worker restarts and repeated short frames from the same segment. Those signals do not prove exploitation, but they provide a way to distinguish a malformed-input bug from an ordinary configuration error.
Top comments (0)