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

CVE-2017-12986 The IPv6 routing header parser in tcpdump before 4.9.2 has a buffer over-read in print-rt6.c:rt6_print().

The IPv6 routing header parser in tcpdump before 4.9.2 has a buffer over-read in print-rt6.c:rt6_print(), triggered by a crafted 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 4 February 2017. Tcpdump 4.9.2 released on 8 September 2017. Patch: https://github.com/the-tcpdump-group/tcpdump/commit/7ac73d6cd41e9d4ac0ca7e6830ca390e195bb21c

The IPv6 routing header parser in tcpdump before 4.9.2 has a buffer over-read in print-rt6.c:rt6_print().

/tcpdump -nr test000
reading from file test000, link-type IPV6 (Raw IPv6)
=================================================================
==567==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60400000e001 at pc 0x00000063663d bp 0x7ffec82f8fb0 sp 0x7ffec82f8fa8
READ of size 1 at 0x60400000e001 thread T0
    #0 0x63663c in rt6_print /root/tcpdump/./print-rt6.c:48:2
    #1 0x57859b in ip6_print /root/tcpdump/./print-ip6.c:328:14
    #2 0x576fdc in ipN_print /root/tcpdump/./print-ip.c:700:3
    #3 0x626677 in raw_if_print /root/tcpdump/./print-raw.c:42:2
    #4 0x4de3c9 in pretty_print_packet /root/tcpdump/./print.c:339:18
    #5 0x4ccb0b in print_packet /root/tcpdump/./tcpdump.c:2555:2
    #6 0x775960 in pcap_offline_read /root/libpcap/./savefile.c:527:4
    #7 0x6a3f3c in pcap_loop /root/libpcap/./pcap.c:1623:8
    #8 0x4c8f1e in main /root/tcpdump/./tcpdump.c:2058:12
    #9 0x7fe428299b44 in __libc_start_main /build/glibc-qK83Be/glibc-2.19/csu/libc-start.c:287
    #10 0x4c419c in _start (/root/tcpdump/tcpdump+0x4c419c)

0x60400000e001 is located 1 bytes to the right of 48-byte region [0x60400000dfd0,0x60400000e000)
allocated by thread T0 here:
    #0 0x4a6b1b in malloc (/root/tcpdump/tcpdump+0x4a6b1b)
    #1 0x7772b3 in pcap_check_header /root/libpcap/./sf-pcap.c:401:14
    #2 0x774fc2 in pcap_fopen_offline_with_tstamp_precision /root/libpcap/./savefile.c:400:7
    #3 0x774d54 in pcap_open_offline_with_tstamp_precision /root/libpcap/./savefile.c:307:6

SUMMARY: AddressSanitizer: heap-buffer-overflow /root/tcpdump/./print-rt6.c:48 rt6_print

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

Impact

An attacker could cause a heap-buffer-overflow read by supplying a crafted capture file.

What the attacker needed

Crafted packet capture file; run tcpdump on the file

The fix

The issue was fixed in tcpdump 4.9.2.

How it was found

  1. Run tcpdump with the -nr options on a crafted capture file named test000.
  2. Observe the AddressSanitizer heap-buffer-overflow error in rt6_print.

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 read the IPv6 routing header let it read past the end of a memory buffer when opening a malicious capture file.

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.