Skip to content

fix(toolkit): the pypcapfile engine parses a later IPv4 fragment's data as a TCP header #1576

Closed

Description

@JarryShaw

With engine='pypcapfile', TCP reassembly reads a later IPv4 fragment's data as a TCP header, and a bogus segment comes out of it.

Repro on main (cc084357f), Python 3.11, pypcapfile 0.12.0. A PCAP holds a SYN, then an IPv4 fragment with offset 1480, protocol 6, and 40 octets of data starting AAAA.

Cause: _transport() in pcapkit/toolkit/pypcapfile.py only checks the protocol number, not whether the frame is a first fragment. #1562 fixed the default engine's version of this.

Expected: a fragment with a non-zero offset is not parsed as a TCP header, as in the default engine.

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