Skip to content

Reject foreign DHCP replies before policy fallback - #196

Merged
edi-oai merged 1 commit into
mainfrom
dev/edi/reject-foreign-dhcp-replies
Aug 17, 2026
Merged

Reject foreign DHCP replies before policy fallback#196
edi-oai merged 1 commit into
mainfrom
dev/edi/reject-foreign-dhcp-replies

Conversation

@edi-oai

@edi-oai edi-oai commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

In #192, additional filtering for DHCP messages coming from the host side was added.

However, foreign DHCP replies were not explicitly rejected and could still fall through to normal host → VM policy and be forwarded to the VM.

Add an enum to properly distinguish between non-DHCP traffic, allowed DHCP replies, and rejected DHCP replies.

/cc @genforAI

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5bc5a21904

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/proxy/host.rs

let Ok(udp_pkt) = UdpPacket::new_checked(ipv4_pkt.payload()) else {
return false;
return DhcpResponseDisposition::NotDhcp;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reject fragmented DHCP replies instead of falling through

When a BOOTP reply is IPv4-fragmented, the first fragment's UDP length describes the complete datagram, so UdpPacket::new_checked rejects the shorter fragment; later fragments contain no UDP header. Returning NotDhcp here sends every fragment through generic policy, which unconditionally permits them when flows is None, allowing the guest to reassemble a foreign DHCP reply and bypass the new client-MAC check. Fragmented gateway UDP traffic must be rejected or reassembled before deciding that it is not DHCP.

Useful? React with 👍 / 👎.

@edi-oai edi-oai Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's handle this separately in #197, seems out-of-scope because this PR doesn't introduce this issue.

@edi-oai
edi-oai merged commit e5fd48c into main Aug 17, 2026
2 checks passed
@edi-oai
edi-oai deleted the dev/edi/reject-foreign-dhcp-replies branch August 17, 2026 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants