Skip to content

fix(toolkit): the pypcapfile engine accepts an IPv4 IHL that runs past the packet #1591

Closed

Description

@JarryShaw

With engine='pypcapfile', an IPv4 header whose IHL runs past the packet still produces an IPv4 input. The default engine rejects the header.

Repro on main, 3.11, pypcapfile 0.12.0: IPv4 with IHL 15 (a 60-octet header) inside a 40-octet packet, DF clear.

  • Default engine: no IPv4 input (pcapkit/protocols/internet/ipv4.py:327 rejects it).
  • pypcapfile: an IPv4 input with a 40-octet header.

Cause: pcapfile's IP (pcapfile/protocols/network/ip.py:50-52) slices without a bounds check, and _network (pcapkit/toolkit/pypcapfile.py:325) and ipv4_reassembly (:635-641) accept the result as it is.

Expected: an IHL past the captured packet gives no IPv4 input, or the same decode warning as the default engine.

Found by the #1575 worker and confirmed by its cross-review. Blocked until #1575 merges.

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