Buffer Overflow Vulnerability in tcpdump and libpcap: CVE-2018-16301

libpcap Updated 02 Oct 2025

Summary

03/10/2019
N/A
Yes i
High
7.8

ALPINE-CVE-2018-16301: The command-line argument parser in tcpdump before 4.99.0 has a buffer overflow in tcpdump.c:read_infile(). Affects libpcap versions < 1.1.1-r0. Fixed in 1.1.1-r0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

tcpdump is a powerful command-line packet analyzer tool used for network traffic monitoring and analysis. It allows users to capture and display the packets being transmitted or received over a network. The libpcap library, which tcpdump relies on, provides a portable framework for low-level network monitoring. This vulnerability affects versions of tcpdump and libpcap prior to their respective patched releases, making them susceptible to exploitation through crafted input files.

Vulnerability Detail

The vulnerability, identified as CVE-2018-16301, arises from a buffer overflow in the command-line argument parser of tcpdump, specifically in the read_infile() function. An attacker can exploit this vulnerability by creating a specially crafted 4GB file and specifying its name using the -F command-line argument. This can lead to arbitrary code execution, potentially compromising the system's integrity and confidentiality. The CVSS score for this vulnerability is 7.8, indicating a high severity level.

How To Fix

Minimum fixed version

1.1.1-r0

This is the first release that contains the fix.

sudo apk add --upgrade libpcap

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using the -F command-line argument with tcpdump until the package is updated to a secure version. This will prevent the exploitation of the buffer overflow vulnerability.

Conclusion

CVE-2018-16301 is a significant vulnerability affecting tcpdump and libpcap that can lead to severe security risks if exploited. Users are strongly advised to update their packages to the latest versions to safeguard their systems. Additionally, utilizing tools like Vulert can help monitor and identify vulnerabilities in real-time.

See every vulnerability recorded for libpcap →

Share this vulnerability

FAQ

CVE-2018-16301 is a buffer overflow vulnerability in tcpdump and libpcap that can be exploited by providing a specially crafted file as input.

Exploitation of this vulnerability can lead to arbitrary code execution, allowing attackers to gain unauthorized access or control over the affected system.

Versions of tcpdump and libpcap prior to 4.9.3-r0 and 1.9.1-r0 respectively are affected by this vulnerability.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to use the Vulert playground.

If immediate updates are not possible, refrain from using the -F command-line argument with tcpdump to mitigate the risk of exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for libpcap.

How To Fix

Minimum fixed version

1.1.1-r0

This is the first release that contains the fix.

sudo apk add --upgrade libpcap

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback