Skip to content

ImpactPacket: validate IPv6, BOOTP, and TCP header fields - #2353

Open
adilalperenciftci wants to merge 1 commit into
fortra:masterfrom
adilalperenciftci:fix/packet-field-validation
Open

adilalperenciftci wants to merge 1 commit into
fortra:masterfrom
adilalperenciftci:fix/packet-field-validation

Conversation

@adilalperenciftci

Copy link
Copy Markdown
Contributor

Summary

I traced inconsistent packet decoding to unchecked fixed-header fields in the IPv6, BOOTP, and TCP paths.

  • Reject IPv6 input shorter than the 40-byte fixed header and version nibbles other than 6.
  • Reject BOOTP operation values outside request/reply, non-positive hardware types, and hardware-address lengths outside the 16-byte chaddr field.
  • Reject truncated TCP headers, data offsets below five words, declared headers beyond the input, nonzero reserved bits, and options without a readable length byte.
  • Slice TCP payload from the validated wire data offset, including when an EOL option precedes header padding.
  • Return ImpactPacketException for these invalid inputs instead of decoding contradictory state or leaking IndexError.

Tests

  • python -m pytest tests/ImpactPacket/test_packet_field_validation_issue1902.py -q - 14 passed, 10 subtests passed.
  • Existing IPv6, IPv6 extension, BOOTP, and TCP regression files - 34 passed.
  • python -m pytest -m "not remote" -q - 842 passed, 9 skipped, 1544 deselected, 60 subtests passed.
  • Critical flake8 checks on all four changed files - 0 findings.

Fixes #1902

Signed-off-by: Adil Alperen Ciftci adilalperenciftci@users.noreply.github.com

I traced inconsistent decoder state to unchecked IPv6, BOOTP, and TCP header fields. I now reject truncated or contradictory headers before child parsing and use the declared TCP data offset for payload boundaries.

I added literal regression coverage for issue fortra#1902.

Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 29, 2026 13:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@anadrianmanrique anadrianmanrique added the in review This issue or pull request is being analyzed label Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review This issue or pull request is being analyzed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Miss constraint checking for packet fields while doing decoding

4 participants