Skip to content

tests: ipv6 hop-by-hop option length past option area - #3215

Closed
uwezkhan wants to merge 1 commit into
OISF:masterfrom
uwezkhan:ipv6-hopopts-bound
Closed

tests: ipv6 hop-by-hop option length past option area#3215
uwezkhan wants to merge 1 commit into
OISF:masterfrom
uwezkhan:ipv6-hopopts-bound

Conversation

@uwezkhan

@uwezkhan uwezkhan commented Jul 4, 2026

Copy link
Copy Markdown

Companion test for OISF/suricata#15695 (reopened as a fresh PR per the workflow).

The hop-by-hop option loop in DecodeIPV6ExtHdrs gated each option on (offset + 1 + ip6_optlen) > optslen, which let an option whose data runs one byte past the option area through; the Router Alert memcpy then read one byte past the area. The fix bounds it on offset + 2 + ip6_optlen.

The pcap is an IPv6 packet (payload len 8, next header hop-by-hop) whose 8-byte hop-by-hop header carries three Pad1 options then a Router Alert declaring 2 data bytes where only 1 fits the option area.

Before the fix: the option is accepted and the RA read runs past the option area.
After the fix: the option is rejected with ipv6.exthdr_invalid_optlen.

@catenacyber

Copy link
Copy Markdown
Collaborator

Replaced by #3305

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.

2 participants