Repository navigation
fix(protocols)!: refuse an MH message or MPTCP DSS option whose length does not fit its fields (#2669) - #2683
Merged
Merged
Conversation
Owner
Author
|
NEEDS CHANGES at
The mobility-option side findings are confirmed and filed as #2684. |
…h does not fit its fields (#2669) MH hands its message Header Len * 8 + 2 octets, and the DSS option the octets its Length declares. A message whose fixed fields need more, or a DSS Length short of the fields its flags give, read the rest as zeros; a DSS Length past them left octets no field took. MH.make and _make_mptcp_dss wrote the length the fields give, so the rebuild differed: a Home Test with Header Len 1 rebuilt from 24 octets to 32, and its 64-octet IPv6 packet to 72. - MH.read refuses a whole message its Header Len cuts short, as RFC 6275 section 9.2 has it discarded and as IPv6-Route type 2 and HIP refuse a short header length. Inside IPv6 the octets stay a Raw payload. - MH.make writes the Header Len a cut capture's info declares, so its short read replays the header as captured, short of the message or not. - TCP._read_mptcp_dss refuses any Length but the RFC 8684 one for its flags, with or without the checksum, as every other registered MPTCP subtype refuses a length the RFC does not give it. - Breaking: MH(raw) and TCP(raw) raise ProtocolError on such input, where they returned a mis-parse. - Tests: one-octet mutations of every registered MH message type, alone and in IPv6, and each cut at every offset of its message; complete DSS options; every DSS flag combination at every length, against RFC 8684 figure 9. The pypcapfile trial's kept-header control cuts a valid MH rather than shortening its Header Len. New modules fail with pcapkit/ reverted; protocol, toolkit, foundation, interface and guard modules pass; captures parse identically to main.
JarryShaw
force-pushed
the
fix/2669-mh-mptcp-rebuild
branch
from
November 2, 2026 21:20
58d3c88 to
1b7807d
Compare
Owner
Author
|
GOOD TO GO at
Shipped captures are identical to |
JarryShaw
added a commit
that referenced
this pull request
Nov 2, 2026
…h refusals and the Windows leg's argument file into 1.6.0 (#2449) - Breaking: MH(raw) and TCP(raw) (#2683) raise ProtocolError for an MH message whose Header Len is short of its fields, or a DSS option of a length its flags do not give, where 1.5.x read the gap as zeros and rebuilt it longer; a cut MH keeps its declared Header Len. The entry gives the old and new results, measured against v1.5.1. - Folded into unreleased entries: radiotap's decoded optional fields, Radiotap.__field__ with register_field and register_radiotap_field, the RadiotapField schemas and pcapkit.const.radiotap with its crawlers (#2657), and cut TLV items decoding zero-padded (#2690), into the Radiotap entry, with the IEEE 802.11 entry's Flags clause corrected; #2657's ruling on code to layout tables, into the conventions entry; the Windows leg's argument file (#2681), into the CI legs entry, as the cycle's other CI changes have entries. - No entry for the test-only 42a6133. - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
1 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectDescription of your pull request and other information
Some complete but malformed MH messages and MPTCP DSS options did not rebuild as captured. A Home Test with Header Len 1 rebuilt from 24 octets to 32, and its 64-octet IPv6 packet to 72. Both now refuse, as their siblings do:
MH.readraisesProtocolErrorwhen a message's fixed fields run past its declared Header Len while that window was fully captured. RFC 6275 has such a message discarded, and IPv6 Routing type 2 and HIP already refuse a header length too short for their fields. Inside IPv6 the octets stay aRawpayload, so the packet rebuilds byte for byte.TCP._read_mptcp_dssrefuses any Length other than the one RFC 8684 gives for its A/a/M/m flags (plus 2 for the checksum), as every other MPTCP subtype and fixed-length TCP option already refuses lengths outside its RFC set.A Header Len longer than the fields round-trips as before. A capture cut inside a message, including one whose Header Len is too short, keeps its declared Header Len through
replay_short_read, so it rebuilds as captured.Breaking:
MH(raw)andTCP(raw)raiseProtocolErrorwhere they used to return a mis-parse. Mutation tests change one octet at a time in every MH message type, alone and in IPv6, and try every DSS flag combination at every length; both fail onmain. Shipped captures parse identically tomain.Closes #2669