Skip to content

fix(toolkit): scapy reads TCP inside an ICMP-quoted 6in4 datagram #1627

Closed

Description

@JarryShaw

With engine='scapy', a TCP segment inside an ICMP error's quoted datagram is handed to TCP reassembly and tracing when the quoted datagram is 6in4. The default engine and dpkt do not read TCP out of a quoted datagram.

Repro on main (ee324e1dc). The capture is Ethernet, then IPv4 (protocol 1), then ICMP Destination Unreachable quoting IPv4 (protocol 41) carrying IPv6 and then TCP. The cells show TCP reassembly inputs / trace inputs.

Quoted datagram default dpkt scapy
6in4, then TCP 0/0 0/0 1/1
4in4, then TCP (control) 0/0 0/0 0/0
TCP (control) 0/0 0/0 0/0

Scapy dissects the quote as IPerror, and IPerror with protocol 41 binds a full IPv6 layer, which then carries a real TCP.

Expected: scapy reads no TCP inside an ICMP-quoted datagram, as the default engine does.

The #1624 cross-review found this; I reproduced it. #1624 does not change it.

Blocked until #1624 merges, because #1624 rewrites scapy's _tcp_carrier.

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. 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 12, 2026
  3. JarryShaw commented on Oct 12, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #1624 merged. A worker is on it together with #1623, since both edit pcapkit/toolkit/scapy.py.

  4. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 13, 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