Critical Memory Allocation Vulnerability in libpcap: CVE-2019-15165
Summary
ALPINE-CVE-2019-15165: sf-pcapng.c in libpcap before 1.9.1 does not properly validate the PHB header length before allocating memory. Affects libpcap versions < 1.1.1-r0. Fixed in 1.1.1-r0. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
libpcap is a widely used library for network traffic capture and analysis. It provides a high-level interface for capturing packets and is essential for various network monitoring tools and applications. The library is designed to abstract the complexities of packet capture across different operating systems, making it a crucial component for developers working in network security and analysis. However, a vulnerability identified as CVE-2019-15165 has been discovered in libpcap versions prior to 1.9.1, which could lead to potential memory allocation issues.
Vulnerability Detail
The vulnerability arises from the sf-pcapng.c file in libpcap, where the PHB header length is not properly validated before memory allocation occurs. This oversight can lead to memory corruption, potentially allowing an attacker to exploit the vulnerability to execute arbitrary code or crash the application. The lack of validation means that crafted packets could be used to manipulate memory allocation, leading to severe consequences in applications relying on libpcap for packet capture.
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
If immediate upgrading is not feasible, consider implementing input validation checks in your application to ensure that any packets processed by libpcap are well-formed and do not exploit this vulnerability. However, this is not a foolproof solution and should only be a temporary measure until the library is updated.
Conclusion
In summary, CVE-2019-15165 is a critical vulnerability in the libpcap library that can lead to memory allocation issues due to improper validation. Users are strongly advised to update to version 1.9.1 or later to mitigate the risk. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for libpcap →
FAQ
CVE-2019-15165 is a vulnerability in libpcap that allows for improper memory allocation due to insufficient validation of the PHB header length.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
Exploiting this vulnerability could lead to memory corruption, allowing attackers to execute arbitrary code or crash applications that utilize libpcap.
Yes, the vulnerability has been patched in libpcap version 1.9.1 and later. It is recommended to upgrade to this version or newer.
The CVSS score for CVE-2019-15165 is 5.3, indicating a medium severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for libpcap.