Heap-Based Buffer Over-Read in libsndfile: CVE-2018-19758
Summary
ALPINE-CVE-2018-19758: There is a heap-based buffer over-read at wav.c in wav_write_header in libsndfile 1.0.28 that will cause a denial of service. Affects libsndfile versions < 1.0.28-r8. Fixed in 1.0.28-r8. 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
libsndfile is a widely-used library for reading and writing audio files in various formats. It provides a simple API for audio file manipulation, making it a popular choice among developers working with audio data. However, the library has been found to have a vulnerability that can lead to serious security issues, particularly in versions prior to 1.0.28-r8.
Vulnerability Detail
The vulnerability identified as CVE-2018-19758 is a heap-based buffer over-read that occurs in the wav_write_header function within the wav.c file of libsndfile version 1.0.28. This flaw can potentially lead to a denial of service, allowing an attacker to exploit the library by causing it to read beyond the intended memory boundaries. The ramifications of this vulnerability can include application crashes and unexpected behavior, making it critical for users of the library to address it promptly.
How To Fix
Minimum fixed version
1.0.28-r8
This is the first release that contains the fix.
sudo apk add --upgrade libsndfile
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate patching is not possible, consider implementing input validation to ensure that the audio files being processed do not trigger the vulnerability. Additionally, avoid using the affected versions of the library until an update can be applied.
Conclusion
The CVE-2018-19758 vulnerability in libsndfile poses a significant risk due to its potential for causing denial of service through a heap-based buffer over-read. Users are strongly advised to update to version 1.0.28-r8 or later to mitigate this risk. For those unable to update immediately, implementing workarounds can help reduce exposure.
See every vulnerability recorded for libsndfile →
FAQ
CVE-2018-19758 is a vulnerability in the libsndfile library that allows for a heap-based buffer over-read, potentially leading to denial of service.
Versions of libsndfile prior to 1.0.28-r8 are affected by this vulnerability.
You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The CVSS score for CVE-2018-19758 is 6.5, indicating a medium severity level.
If you cannot update the library, consider implementing input validation and avoid using the affected versions until a patch can be applied.
References
Related vulnerabilities
Recent vulnerabilities recorded for libsndfile.