Skip to content

dhcp: verify option 52 overload parsing#3074

Open
ssam18 wants to merge 2 commits into
OISF:masterfrom
ssam18:dhcp-option-52-overload-v1
Open

dhcp: verify option 52 overload parsing#3074
ssam18 wants to merge 2 commits into
OISF:masterfrom
ssam18:dhcp-option-52-overload-v1

Conversation

@ssam18
Copy link
Copy Markdown

@ssam18 ssam18 commented May 9, 2026

This adds an integration test for issue 8538, the request to make Suricata parse DHCP options carried inside the BOOTP sname or file fields when Option Overload (52) is set. The pcap captures two parallel flows with the same xid, one benign and one where the OFFER and ACK hide dns_servers, routers and domain inside an overloaded sname while keeping the inline options block looking innocuous. The test asserts that the EVE dhcp events for the overloaded OFFER and ACK now expose those values, and that the benign flow in the same capture still reports its inline values unchanged. This is the verify side companion to OISF/suricata#15340.

Add a verification test that runs Suricata over a pcap where the server places dns_servers, routers and a domain inside the BOOTP sname continuation area while flagging Option Overload (52) value 2 in the standard options block. The test asserts that the EVE DHCP events for both the OFFER and the ACK now expose those
overloaded values and that the parallel non overloaded flow in the same capture still reports its inline values.

Bug: #8538.
@jasonish
Copy link
Copy Markdown
Member

I'm worried this pcap from the ticket is very synthetic. Do you have any real pcaps showing this option being used?

@ssam18
Copy link
Copy Markdown
Author

ssam18 commented May 25, 2026

I'm worried this pcap from the ticket is very synthetic. Do you have any real pcaps showing this option being used?

Yes, it's synthetic. Option 52 overload is rare enough in the wild that I don't have a production capture either, but the Wireshark sample collection has PRIV_bootp-both_overload.pcap (https://wiki.wireshark.org/SampleCaptures), which has been the canonical reference capture for this feature for years.

I would suggest adding it as a second test directory rather than swapping out my current pcap. The Wireshark sample covers overload value 3 (both sname and file overloaded) on a single packet; my current synthetic covers overload value 2 (sname only) on an OFFER/ACK pair plus a benign control flow. Different overload modes, complementary coverage. Happy to just swap it instead if you would prefer the smaller test footprint.

Copy link
Copy Markdown
Collaborator

@catenacyber catenacyber left a comment

Choose a reason for hiding this comment

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

Looks like a good SV test

@jasonish
Copy link
Copy Markdown
Member

I'm worried this pcap from the ticket is very synthetic. Do you have any real pcaps showing this option being used?

Yes, it's synthetic. Option 52 overload is rare enough in the wild that I don't have a production capture either, but the Wireshark sample collection has PRIV_bootp-both_overload.pcap (https://wiki.wireshark.org/SampleCaptures), which has been the canonical reference capture for this feature for years.

I would suggest adding it as a second test directory rather than swapping out my current pcap. The Wireshark sample covers overload value 3 (both sname and file overloaded) on a single packet; my current synthetic covers overload value 2 (sname only) on an OFFER/ACK pair plus a benign control flow. Different overload modes, complementary coverage. Happy to just swap it instead if you would prefer the smaller test footprint.

An additional test would be great.

Companion to dhcp-option-52-overload (overload value 2, sname only). This adds a second test using PRIV_bootp-both_overload.pcap from the Wireshark sample collection, which exercises overload value 3 (both sname and file overloaded) on a single DHCP DISCOVER -- the canonical
reference capture for BOOTP option overload.

The Wireshark sample only carries Option 56 (DHCP Message) in the overloaded areas, which the EVE DHCP logger does not currently emit, so this test does not assert on the overloaded-area content itself. It does verify the parser cleanly processes a real-world overload=3 packet without dropping the event and that the inline-option fields (dhcp_type, id, client_mac, lease_time) still surface correctly -- a regression guard for the Option 52 overload code path. Bug: #8538.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires suricata pr Depends on a PR in Suricata

Development

Successfully merging this pull request may close these issues.

4 participants