Skip to content
Memory corruption Disclosed report Intermediate CVE-2017-13010

CVE-2017-13010 The BEEP parser in tcpdump before 4.9.2 has a buffer over-read in print-beep.c:l_strnstart().

The BEEP parser in tcpdump before 4.9.2 has a buffer over-read in print-beep.c:l_strnstart(). An attacker could cause a heap-buffer-overflow read by supplying a crafted packet capture file.

geeknik Follow

Originally disclosed on HackerOne

High 7.3 View original
  • Fixed in 3 months
  • Paid in 3 months
  • Disclosed after 2.1 years

Reported to the devs on 6 March 2017. Tcpdump 4.9.2 released on 8 September 2017. Patch: https://github.com/the-tcpdump-group/tcpdump/commit/877b66b398518d9501513e0860c9f3a8acc70892

The BEEP parser in tcpdump before 4.9.2 has a buffer over-read in print-beep.c:l_strnstart().

./tcpdump -n -r test005

==28756==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60600000f004 at pc 0x000000448f71 bp 0x7ffe8e433bd0 sp 0x7ffe8e433388
READ of size 1 at 0x60600000f004 thread T0
    #0 0x448f70 in strncmp (/root/tcpdump/tcpdump+0x448f70)
    #1 0x508343 in l_strnstart /root/tcpdump/./print-beep.c:37:10
    #2 0x508343 in beep_print /root/tcpdump/./print-beep.c:44
    #3 0x671447 in tcp_print /root/tcpdump/./print-tcp.c:703:17
    #4 0x57617c in ip6_print /root/tcpdump/./print-ip6.c:345:4
    #5 0x57453c in ipN_print /root/tcpdump/./print-ip.c:700:3
    #6 0x626c07 in raw_if_print /root/tcpdump/./print-raw.c:42:2
    #7 0x4de2e9 in pretty_print_packet /root/tcpdump/./print.c:339:18
    #8 0x4cc5fb in print_packet /root/tcpdump/./tcpdump.c:2556:2
    #9 0x773e00 in pcap_offline_read /root/libpcap/./savefile.c:527:4
    #10 0x6a257c in pcap_loop /root/libpcap/./pcap.c:1657:8
    #11 0x4c8a6e in main /root/tcpdump/./tcpdump.c:2059:12
    #12 0x7f651cfa4b44 in __libc_start_main /build/glibc-qK83Be/glibc-2.19/csu/libc-start.c:287
    #13 0x4c3ccc in _start (/root/tcpdump/tcpdump+0x4c3ccc)

0x60600000f004 is located 4 bytes to the right of 64-byte region [0x60600000efc0,0x60600000f000)
allocated by thread T0 here:
    #0 0x4a664b in __interceptor_malloc (/root/tcpdump/tcpdump+0x4a664b)
    #1 0x775753 in pcap_check_header /root/libpcap/./sf-pcap.c:401:14
    #2 0x773462 in pcap_fopen_offline_with_tstamp_precision /root/libpcap/./savefile.c:400:7
    #3 0x7731f4 in pcap_open_offline_with_tstamp_precision /root/libpcap/./savefile.c:307:6

SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 strncmp

The original report as published on HackerOne, by geeknik. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 missing bounds check before calling strncmp on a buffer that may be shorter than the compared length.

Impact

A crafted packet capture could cause tcpdump to read out of bounds.

What the attacker needed

Ability to supply a crafted capture file

The fix

The issue was fixed in tcpdump 4.9.2.

How it was found

  1. Run tcpdump with the -n -r options on a crafted capture file named test005.

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.

A bug in how tcpdump reads the BEEP protocol means a crafted capture file can make it read past the end of a memory buffer. This is a memory safety issue.

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.

More by geeknik

View all

79 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.