CVE-2017-5342 In tcpdump before 4.9.0 a bug in multiple protocol parsers could cause a buffer overflow in print-ether.c:ether_print()
In tcpdump before 4.9.0, several protocol parsers passed the on-wire length instead of the captured length to ether_print(), causing it to read beyond the allocated packet buffer. An attacker could trigger a buffer overflow by supplying a crafted packet that reaches these parsers.
- Fixed in 10 months
- Paid in 10 months
- Disclosed after 2.7 years
Reported to the project maintainers in 2016. gre_print_0() and the functions modelled after it passed the value of "length" instead of the value of "caplen", this could make ether_print() access beyond the memory allocated for the captured packet. Fixed by https://github.com/the-tcpdump-group/tcpdump/commit/0db4dcafe5ae38201d3869c96a96cb714d82ff35.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a parameter mix-up where the captured length (caplen) was replaced by the full packet length (length) when calling ether_print(), so bounds checks used the wrong value.
What the attacker needed
Crafted packet; tcpdump before 4.9.0
The fix
It was fixed by a commit to the tcpdump project.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
tcpdump is a tool that reads network packets. Each packet has a real size on the wire and a smaller size that was actually saved, and the code confused the two. That made the program read past the end of the saved data, which can crash it or corrupt memory.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.