Skip to content

[8.19](backport #48414) Refactor and update packetbeat DHCP parsers#48735

Open
mergify[bot] wants to merge 1 commit into8.19from
mergify/bp/8.19/pr-48414
Open

[8.19](backport #48414) Refactor and update packetbeat DHCP parsers#48735
mergify[bot] wants to merge 1 commit into8.19from
mergify/bp/8.19/pr-48414

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Feb 6, 2026

Proposed commit message

This is a rather large PR that completely updates the DHCPv4 parser for a number of reasons:

  1. Numerous portions of the code did not properly handle malformed data, making it easy to craft packets that could crash packetbeat
  2. A lot of the above-mentioned buggy code came from custom logic rendered obsolete by newer versions of the DHCP parsing library we were using.
  3. Our code did not conform to the DHCPv4 spec; some options, such as router allow for multiple address fields, although we only parsed the first field.

Putting this in draft, as there's portions of the code I need to clean up, and I would like to add more tests.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works. Where relevant, I have used the stresstest.sh script to run them under stress conditions and race detector to verify their stability.
  • I have added an entry in ./changelog/fragments using the changelog tool.

Disruptive User Impact

The router field now returns a list, and not a single address. Returning a single address is technically not in spec, and was a bug.


This is an automatic backport of pull request #48414 done by [Mergify](https://mergify.com).

* working

* fix typo

* format

* add changelog

* cleanup

* still cleaning up

* add tests

* update changelog

* update go files

(cherry picked from commit a64fa45)

# Conflicts:
#	go.mod
#	go.sum
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Feb 6, 2026
@mergify mergify bot requested review from a team as code owners February 6, 2026 16:26
@mergify
Copy link
Contributor Author

mergify bot commented Feb 6, 2026

Cherry-pick of a64fa45 has failed:

On branch mergify/bp/8.19/pr-48414
Your branch is up to date with 'origin/8.19'.

You are currently cherry-picking commit a64fa457c.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   NOTICE.txt
	new file:   changelog/fragments/1768328474-refactor-dhcpv4-fix-parsing-bugs.yaml
	modified:   packetbeat/decoder/decoder.go
	modified:   packetbeat/protos/dhcpv4/dhcpv4.go
	modified:   packetbeat/protos/dhcpv4/dhcpv4_test.go
	deleted:    packetbeat/protos/dhcpv4/option_ip_address.go
	deleted:    packetbeat/protos/dhcpv4/option_ip_addresses.go
	deleted:    packetbeat/protos/dhcpv4/option_text.go
	modified:   packetbeat/protos/dhcpv4/options.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   go.mod
	both modified:   go.sum

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot requested review from VihasMakwana and orestisfl and removed request for a team February 6, 2026 16:26
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions github-actions bot added the Team:Security-Linux Platform Linux Platform Team in Security Solution label Feb 6, 2026
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 6, 2026
@elasticmachine
Copy link
Contributor

Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts There is a conflict in the backported pull request Team:Security-Linux Platform Linux Platform Team in Security Solution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants