Critical Buffer Overflow Vulnerability in wolfSSL Affects Debian Packages
Summary
DEBIAN-CVE-2024-5991: In function MatchDomainName(), input param str is treated as a NULL terminated string despite being user provided and unchecked. Affects wolfssl versions < 5.7.2-0.1. Fixed in 5.7.2-0.1. 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
wolfSSL is a lightweight SSL/TLS library designed for embedded and IoT applications, providing secure communication for various platforms. It is widely used due to its efficiency and small footprint. However, a critical vulnerability has been identified that affects versions up to 5.7.0, which could lead to buffer overflow issues, potentially compromising system security.
Vulnerability Detail
The vulnerability arises in the MatchDomainName() function, where the input parameter 'str' is treated as a NULL-terminated string without proper validation. The function X509_check_host() accepts a pointer and length for validation, but lacks checks for NULL termination. This oversight means that if a non-NULL terminated buffer is passed, the function may read beyond the intended bounds, leading to potential memory corruption and security breaches.
How To Fix
Minimum fixed version
5.7.2-0.1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade wolfssl
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, ensure that any input passed to the MatchDomainName() function is properly NULL-terminated before calling the function. This can be done by checking the length of the input and appending a NULL character if necessary.
Conclusion
The identified vulnerability in wolfSSL poses a significant risk to applications using affected versions. It is crucial to update to the patched version to mitigate potential security threats. Additionally, implementing input validation can serve as a temporary workaround until the update is applied.
See every vulnerability recorded for wolfssl →
FAQ
The vulnerability can lead to buffer overflow, which may allow attackers to execute arbitrary code or crash the application.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.
Versions of wolfSSL up to 5.7.0 are affected by this vulnerability.
Yes, a patch is available in version 5.7.2-0.1 and later.
If you cannot update immediately, ensure that all inputs to the vulnerable function are properly validated and NULL-terminated as a temporary measure.
References
Related vulnerabilities
Recent vulnerabilities recorded for wolfssl.