Heap-Based Buffer Over-Read in libsndfile: CVE-2018-19758

libsndfile Updated 02 Oct 2025

Summary

30/11/2018
N/A
Yes i
Medium
6.5

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 ↓

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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

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 →

Share this vulnerability

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.

Related vulnerabilities

Recent vulnerabilities recorded for libsndfile.

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 →

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