Skip to content

v4.6.4

Latest

Choose a tag to compare

@fklassen fklassen released this 23 Nov 02:29
v4.6.4
b6a962c

Tcpreplay 4.6.4 is a bugfix release. It fixes two memory-safety vulnerabilities reported through GitHub security advisories, in tcpedit's user DLT encoder and in the Juniper JUNIPER_FLAG_NO_L2 handling shared by tcpprep, flow statistics and --unique-ip. It also fixes --fuzz-seed applying every edit twice, DLT_NULL captures never being recognised as IP, and a set of smaller bugs in CIDR parsing, tcpcapinfo and big-endian and strict-alignment handling.

Highlights

  • Two security advisories fixed, both medium severity and both reachable from a crafted pcap or option set: a heap buffer underflow write in dlt_user_encode() (GHSA-qqfw-8w7m-fmxx) and a wild pointer read or heap overflow on Juniper frames with JUNIPER_FLAG_NO_L2 (GHSA-vvvj-v4jv-xqg8)
  • --fuzz-seed applies each edit once. Before, every non-idempotent edit (--ttl=+5, --tcp-sequence, portmap chains, --enet-vlan=add) ran twice (#1221)
  • DLT_NULL captures are recognised as IP by flow statistics, tcpprep classification and --unique-ip (#1220)
  • Advisory GHSA-9x76-w8p7-m2m7 published. The ip_opt/ip_chaff fix shipped in 4.6.3 (#1179); this release adds a regression test for the second reproducer (#1225)

Security advisories

Advisory Affected Fault Fix
GHSA-qqfw-8w7m-fmxx 4.0.0 - 4.6.3 tcpedit with --dlt=user and no --user-dlink moved the packet tail to one byte before the packet buffer (heap buffer underflow write) --user-dlink is now required, and dlt_user_encode() checks the header length (9028d4a)
GHSA-vvvj-v4jv-xqg8 4.4.1 - 4.6.3 get_l2len_protocol() left the L2 length at 0 for JUNIPER_FLAG_NO_L2 frames, so get_ipv4() and get_ipv6() wrapped an unsigned subtraction and read the IP header through a wild pointer; with FORCE_ALIGN the copy length overflowed the packet buffer get_l2len_protocol() sets the L2 length to the IP offset (#1223)
GHSA-9x76-w8p7-m2m7 <= 4.6.2 fragroute ip_opt and ip_chaff opt passed a negative size to memmove() for a packet whose ip_len was below its header length Fixed in 4.6.3 (#1179); regression test for the ihl 8, ip_len 20 case added here (#1225)

Behavior changes

  • --dlt=user without --user-dlink is an error. Before, it crashed or wrote before the packet buffer
  • --fuzz-seed applies each edit once. Output for non-idempotent edits differs from 4.6.3, which applied them twice (#1221)
  • IPv4 prefix lengths below 0 are rejected in -N, --pnat, --srcipmap, --dstipmap, --endpoints, tcpprep -c and --include/--exclude (#1216)
  • tcpcapinfo refuses any pcap version other than 2.4, and skips packets larger than its 64 KB read buffer (#1217)
  • Flow statistics, tcpprep classification and --unique-ip now count DLT_NULL captures as IP, so their results change for such captures (#1220)

Other fixes

  • common: /0 IPv4 masks no longer shift by 32, which is undefined behavior (#1216)
  • tcpedit: the Juniper Ethernet plugin decoded its extension length as 0 on big-endian hosts, so the Ethernet header was parsed from the wrong offset (#1218)
  • tcpedit: ARP address rewriting and --seed on ARP no longer access the addresses through misaligned uint32_t pointers, which could fault on strict-alignment CPUs (#1219)
  • test: ip_opt on a packet whose ip_len is below its header is covered by a unit test (#1225)

Credits

Thanks to @shootduck for GHSA-qqfw-8w7m-fmxx and GHSA-vvvj-v4jv-xqg8, and to @kta1kri for GHSA-9x76-w8p7-m2m7.

What's Changed

New Contributors

None.

Verifying the download

The .tar.gz/.tar.xz tarballs are accompanied by detached PGP signatures (.asc), signed with the tcpreplay release key (tcpreplay@appneta.com, fingerprint 84E4FA215C934A7D97DC76D5E9E2149793BDE17E):

gpg --verify tcpreplay-4.6.4.tar.xz.asc tcpreplay-4.6.4.tar.xz

Full Changelog: v4.6.3...v4.6.4