Skip to content

dhcp parse continuation areas when option 52 overload is set#15340

Closed
ssam18 wants to merge 1 commit intoOISF:mainfrom
ssam18:dhcp-option-52-overload
Closed

dhcp parse continuation areas when option 52 overload is set#15340
ssam18 wants to merge 1 commit intoOISF:mainfrom
ssam18:dhcp-option-52-overload

Conversation

@ssam18
Copy link
Copy Markdown

@ssam18 ssam18 commented May 8, 2026

Suricata only parsed DHCP options from the standard options area, so anything carried in the overloaded sname or file BOOTP fields was invisible to both EVE logging and detection. The reporter on issue 8538 attached a pcap where a server places dns server, router, and domain options entirely inside sname while the visible options look benign, and the current parser misses all of it. With this change we look at option 52 after parsing the main options and walk whichever continuation areas it points at, appending what we find to the same options vector that downstream code already iterates. New unit tests cover all three overload values, a malformed continuation case, and the actual pcap from the issue.

Per RFC 2132 the BOOTP sname and file fields can hold extra DHCP options when option 52 is present, but the parser ignored them. After parsing the main options we now look up option 52 and walk sname or file as additional option streams, appending what we find to the same options vector so the logger and detection keywords see overloaded values too.
@ssam18 ssam18 requested a review from jasonish as a code owner May 8, 2026 20:05
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

NOTE: This PR may contain new authors.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 9, 2026

Codecov Report

❌ Patch coverage is 96.08939% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.66%. Comparing base (8968b1c) to head (cb809d9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15340      +/-   ##
==========================================
- Coverage   82.66%   82.66%   -0.01%     
==========================================
  Files         995      995              
  Lines      271046   271225     +179     
==========================================
+ Hits       224069   224201     +132     
- Misses      46977    47024      +47     
Flag Coverage Δ
fuzzcorpus 61.05% <90.32%> (-0.01%) ⬇️
livemode 18.37% <0.00%> (-0.02%) ⬇️
netns 22.58% <0.00%> (-0.05%) ⬇️
pcap 45.18% <35.48%> (-0.05%) ⬇️
suricata-verify 66.39% <35.48%> (-0.02%) ⬇️
unittests 58.60% <96.08%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@victorjulien victorjulien left a comment

Choose a reason for hiding this comment

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

Thanks for looking into this.

However, please make sure to follow our contribution guidelines:
https://docs.suricata.io/en/latest/devguide/contributing/index.html

@ssam18
Copy link
Copy Markdown
Author

ssam18 commented May 9, 2026

Superseded by #15348 which addresses the contribution guideline feedback (subsystem prefixed commit, ticket reference, separate docs commit, branch v2). The verify side test is in OISF/suricata-verify#3074.

@ssam18 ssam18 closed this May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants