Repository navigation
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 withJUNIPER_FLAG_NO_L2(GHSA-vvvj-v4jv-xqg8) --fuzz-seedapplies each edit once. Before, every non-idempotent edit (--ttl=+5,--tcp-sequence, portmap chains,--enet-vlan=add) ran twice (#1221)DLT_NULLcaptures are recognised as IP by flow statistics,tcpprepclassification and--unique-ip(#1220)- Advisory GHSA-9x76-w8p7-m2m7 published. The
ip_opt/ip_chafffix 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=userwithout--user-dlinkis an error. Before, it crashed or wrote before the packet buffer--fuzz-seedapplies 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 -cand--include/--exclude(#1216) tcpcapinforefuses any pcap version other than 2.4, and skips packets larger than its 64 KB read buffer (#1217)- Flow statistics,
tcpprepclassification and--unique-ipnow countDLT_NULLcaptures as IP, so their results change for such captures (#1220)
Other fixes
- common:
/0IPv4 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
--seedon ARP no longer access the addresses through misaligneduint32_tpointers, which could fault on strict-alignment CPUs (#1219) - test:
ip_opton a packet whoseip_lenis 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
- cidr: reject negative IPv4 prefix lengths, don't shift by 32 for /0 by @tcpreplay-dev in #1216
- tcpcapinfo: reject any pcap version but 2.4, skip packets over 64 KB by @tcpreplay-dev in #1217
- dlt_jnpr_ether: decode the extension length on big-endian hosts by @tcpreplay-dev in #1218
- tcpedit: don't access ARP addresses through misaligned uint32_t pointers by @tcpreplay-dev in #1219
- get.c: skip DLT_NULL's 4-byte address-family header by @tcpreplay-dev in #1220
- tcpedit: apply each edit once with --fuzz-seed by @tcpreplay-dev in #1221
- dlt_user: require --user-dlink and bound the header length in 9028d4a
- docs: credit shootduck for GHSA-qqfw-8w7m-fmxx by @fklassen in #1222
- get: set l2len for Juniper frames with JUNIPER_FLAG_NO_L2 by @fklassen in #1223
- docs: credit shootduck for GHSA-vvvj-v4jv-xqg8 by @fklassen in #1224
- fragroute: test ip_opt on a packet with ip_len below ip_hl; credit kta1kri by @fklassen in #1225
- 4.6.4: add CHANGELOG entry, bump version by @fklassen in #1226
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