Stack buffer overflow vulnerability in setbit() - tcpflow 1.5.0
Loginsoft-2018-18409
October 30, 2018
CVE Number
CVE-2018-18409
CWE
CWE-121: Stack-based Buffer Overflow
Product Details
tcpflow is an open source program which is used to capture the data transmitted as part of TCP connections, it also stores the data for the protocol analysis and for debugging issue
URL:https://github.com/simsong/tcpflow/wiki
Vulnerable Versions
1.5.0 branch
Vulnerability Details
A stack buffer over flow was discovered in the tcpflow binary of tcpflow 1.5.0. The issue gets triggered in the function setbit() at iptree.h, causing a denial of service.
SYNOPSIS
In this method when a pcap files is passed as an input to the binary where it reads the packets, analyze and plot it to a output pdf file, Once the packet stream is passed into the binary then it shutdowns all the scanners using the function be13::plugin::phase_shutdown()
, it also gets the current version of the package using . It initialize the report generator using the one_page_report::render_pass::render_header()
function and also uses <address_histogram::address_histogram()
which converts into a suitable vector for count histogram then starts a histogram tree by starting a particular node. Histogram is reported for every node. The function setbit()
tries to set the i'th bit to one. The signed integer value of "i" is 127 which is the limit for that and when a crafted packet is been injected which makes the value of "i" to 128 which has overwritten the memory and triggered a Stack-based buffer overflow vulnerability.
Analysis
ASAN Output
Proof of Concept
tcpflow -a -D -b -m -Fk -r $POC
Timeline
Vendor Disclosure: 2018-10-02
Public Disclosure: 2018-10-03
Credit
Discovered by ACE Team - Loginsoft