CVE-2018-16300
📋 TL;DR
This vulnerability in tcpdump's BGP parser allows attackers to cause a stack overflow through unlimited recursion in the bgp_attr_print() function. This can lead to denial of service (crash) or potentially arbitrary code execution. Anyone using tcpdump to analyze BGP traffic is affected.
💻 Affected Systems
- tcpdump
📦 What is this software?
Tcpdump by Tcpdump
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to full system compromise if the stack overflow can be controlled to execute arbitrary code.
Likely Case
Denial of service through tcpdump crash when processing malicious BGP packets, potentially disrupting network monitoring.
If Mitigated
Limited to tcpdump process crash with no system-wide impact if proper privilege separation is in place.
🎯 Exploit Status
Exploitation requires sending specially crafted BGP packets that tcpdump processes. The vulnerability is in the parser itself, not requiring authentication.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 4.9.3 and later
Vendor Advisory: https://github.com/the-tcpdump-group/tcpdump/blob/tcpdump-4.9/CHANGES
Restart Required: No
Instructions:
1. Update tcpdump to version 4.9.3 or later using your package manager. 2. For Linux: 'sudo apt update && sudo apt upgrade tcpdump' (Debian/Ubuntu) or 'sudo yum update tcpdump' (RHEL/CentOS). 3. Verify installation with 'tcpdump --version'.
🔧 Temporary Workarounds
Disable BGP parsing
allAvoid parsing BGP packets by using tcpdump filters to exclude BGP traffic
tcpdump not port 179
tcpdump not proto bgp
Limit tcpdump privileges
linuxRun tcpdump with reduced privileges to limit potential damage
sudo -u nobody tcpdump [options]
🧯 If You Can't Patch
- Restrict tcpdump usage to trusted users only and monitor for crashes
- Implement network segmentation to limit exposure to BGP traffic from untrusted sources
🔍 How to Verify
Check if Vulnerable:
Run 'tcpdump --version' and check if version is below 4.9.3
Check Version:
tcpdump --version | head -1
Verify Fix Applied:
Confirm tcpdump version is 4.9.3 or higher with 'tcpdump --version | head -1'
📡 Detection & Monitoring
Log Indicators:
- tcpdump crash logs
- segmentation fault errors in system logs when running tcpdump
Network Indicators:
- Unusual BGP traffic patterns targeting monitoring systems
- Multiple BGP attribute updates in quick succession
SIEM Query:
process_name="tcpdump" AND (event_type="crash" OR exit_code="139")
🔗 References
- http://lists.opensuse.org/opensuse-security-announce/2019-10/msg00050.html
- http://lists.opensuse.org/opensuse-security-announce/2019-10/msg00053.html
- http://seclists.org/fulldisclosure/2019/Dec/26
- https://github.com/the-tcpdump-group/tcpdump/blob/tcpdump-4.9/CHANGES
- https://github.com/the-tcpdump-group/tcpdump/commit/af2cf04a9394c1a56227c2289ae8da262828294a
- https://lists.debian.org/debian-lts-announce/2019/10/msg00015.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/62XY42U6HY3H2APR5EHNWCZ7SAQNMMJN/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FNYXF3IY2X65IOD422SA6EQUULSGW7FN/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/R2UDPOSGVJQIYC33SQBXMDXHH4QDSDMU/
- https://seclists.org/bugtraq/2019/Dec/23
- https://seclists.org/bugtraq/2019/Oct/28
- https://security.netapp.com/advisory/ntap-20200120-0001/
- https://support.apple.com/kb/HT210788
- https://usn.ubuntu.com/4252-1/
- https://usn.ubuntu.com/4252-2/
- https://www.debian.org/security/2019/dsa-4547
- http://lists.opensuse.org/opensuse-security-announce/2019-10/msg00050.html
- http://lists.opensuse.org/opensuse-security-announce/2019-10/msg00053.html
- http://seclists.org/fulldisclosure/2019/Dec/26
- https://github.com/the-tcpdump-group/tcpdump/blob/tcpdump-4.9/CHANGES
- https://github.com/the-tcpdump-group/tcpdump/commit/af2cf04a9394c1a56227c2289ae8da262828294a
- https://lists.debian.org/debian-lts-announce/2019/10/msg00015.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/62XY42U6HY3H2APR5EHNWCZ7SAQNMMJN/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FNYXF3IY2X65IOD422SA6EQUULSGW7FN/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/R2UDPOSGVJQIYC33SQBXMDXHH4QDSDMU/
- https://seclists.org/bugtraq/2019/Dec/23
- https://seclists.org/bugtraq/2019/Oct/28
- https://security.netapp.com/advisory/ntap-20200120-0001/
- https://support.apple.com/kb/HT210788
- https://usn.ubuntu.com/4252-1/
- https://usn.ubuntu.com/4252-2/
- https://www.debian.org/security/2019/dsa-4547