Conversation
The classifier in proxy::host reads a gateway DHCP reply to find the VM MAC. It looked at the first fragment only. An attacker on the gateway link could split the reply so the first fragment holds no complete BOOTP header. The classifier then read past it and matched the wrong bytes. That let traffic through the gateway check. Check the fragment offset before the parse. A reply that arrives in more than one fragment is now rejected, since a real DHCP reply from the gateway is a single datagram. Add tests for the fragmented and unfragmented cases.
RainieLLM
force-pushed
the
fix/reject-fragmented-gateway-udp
branch
from
September 19, 2026 01:48
cb1dcf7 to
f6f5280
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #197
Summary
The DHCP reply classifier parsed the UDP header before it checked the IPv4 fragment fields. A fragmented reply could then be treated as
NotDhcp. In stateless mode, that path allowed the packet without the VM MAC check, so a foreign DHCP reply could reach the guest.This change rejects gateway fragments before the UDP parse. Complete replies keep the existing VM MAC check. Fragments from other sources remain
NotDhcp.Tests
The new tests cover first and later gateway fragments, valid and foreign complete replies, and fragments from other sources.
cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo test --lib proxy::host::tests