-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heap overflow in csum_replace4() #488
Comments
This is a 62 byte long buffer (16 pcap header, 14 ethernet header, 20 IPv4 header, 12 truncated TCP header), i.e. malformed TCP packet cut right after ports, seq and ack number. The code accesses checksum (offset 16 in TCP header, 66 relative to buffer start) without checking we have a complete TCP header. At the first glance, the solution seems to be adding length checks to branches of the |
This issue was assigned CVE-2018-18407 |
@mkubecek thanks for the analysis. It appears that the reason for the malformed packet 62 type packet is that the IP header size has been hacked. Whereas if the value was 5, the packet would make instead it is 9. That increases the IP header size from 20 to 36. I inherited this project with little to no checking for invalid IP packets and hand crafted PCAP files. I'm trying to hack my own PCAP in order to plug these holes. |
fixed in PR #496 |
* 4.3: (22 commits) Bug #418 don't ignore 2nd packet timing Bug #411 allow TAP on all platforms Bug #174 ensure --with-testnic does not affect replay Bug #406 change packet length to network order Bug #413 fix manpage typos Bug #485 Heap overflow fixed in #484 Enhancement_#482 update CHANGELOG/CREDITS Enhancement_#482 test Makefile merge error fixup Enhancement_#482 test Makefile cleanup Bug #489 free after memcpy Bug #488 heap overflow csum replace4 (#496) Bug #486 CVE-2018-17974 realloc memory if packet size increases (#492) Enhancement #493 - fixes for Codacy identified issues Bug #486 Enforce max snaplen rather than doing realloc Bug #486 CVE-2018-17974 realloc memory if packet size increases Bug #484 CVE-2018-17582 Check for corrupt PCAP files 4.3 - revert travis updates from merge Simplify plugin Makefiles allow out-of-tree build Remove dead code ...
…ging * 4.3: (36 commits) Enhancement #506 disable C99 and fix warnings (#507) Bug #418 don't ignore 2nd packet timing Bug #411 allow TAP on all platforms Bug #174 ensure --with-testnic does not affect replay Bug #406 change packet length to network order Bug #413 fix manpage typos Bug #485 Heap overflow fixed in #484 Enhancement_#482 update CHANGELOG/CREDITS Enhancement_#482 test Makefile merge error fixup Enhancement_#482 test Makefile cleanup Bug #489 free after memcpy Bug #488 heap overflow csum replace4 (#496) Bug #486 CVE-2018-17974 realloc memory if packet size increases (#492) Enhancement #493 - fixes for Codacy identified issues Bug #486 Enforce max snaplen rather than doing realloc Bug #486 CVE-2018-17974 realloc memory if packet size increases Bug #484 CVE-2018-17582 Check for corrupt PCAP files 4.3 - revert travis updates from merge Simplify plugin Makefiles allow out-of-tree build ...
A heap-based buffer overflow was discovered in tcpreplay-edit binary, during the incremental checksum operation. The issue is being triggered in the function
csum_replace4()
atincremental_checksum.h
, invoked byipv4_l34_csum_replace()
inedit_packet.c
.Tested version:
4.3
Command:
tcpreplay-edit --portmap=80:8000 --seed=10 --cachefile=example.cache --intf1=eno1 --intf2=eno3 --decode=some --preload-pcap --verbose $POC
Debugging:
ASAN Report
Please check if you are able to reproduce the issue via the Reproducer file
The text was updated successfully, but these errors were encountered: