Skip to content

fix(toolkit): the pypcapfile engine accepts IPv4 headers whose options the default engine rejects #1596

Closed

Description

@JarryShaw

With engine='pypcapfile', an IPv4 header whose options the default engine rejects still produces IPv4 and TCP input, so TCP reassembly and tracing include the frame.

Repro on main (e9f3340f7), Python 3.11, pypcapfile 0.12.0: Ethernet + IPv4 with IHL 6 + TCP carrying data. I tried three option bytes:

IPv4 options Default engine pypcapfile
valid NOP×4 1 TCP datagram 1 TCP datagram
option 7 with length 1 (malformed) 0 1
option 7 whose length runs past the header 0 1

Cause: pcapfile's IP decoder never parses the options. _network in pcapkit/toolkit/pypcapfile.py accepts the header as it is, while the default engine's IPv4 option parser rejects these headers.

Expected: the same IPv4 and TCP inputs as the default engine, i.e. none for a header with malformed options. Failing that, a decode warning.

Found by the #1575 round-3 cross-review fuzz, which saw 272–290 TCP cases per 2,500 frames. I reproduced it independently. Blocked until #1575 merges, because the fix is in the same file.

Activity

  1. added
    fixPull requests that fix a defect (fix: subject prefix)
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 10, 2026
  2. moved this to Blocked in PyPCAPKiton Oct 10, 2026
  3. JarryShaw commented on Oct 10, 2026

    @JarryShaw
    OwnerAuthor

    Work has started ahead of #1575 merging, together with #1590–#1593 and #1596 because all five are in the same pypcapfile.py header walk. It is on a branch built on #1575's head 1de91947b. The PR opens, rebased onto main, once #1575 merges.

  4. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 10, 2026
  5. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixPull requests that fix a defect (fix: subject prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions