Heap-buffer-overflow in libheif: HeifContext::interpret_heif_file

libheif Updated 02 Oct 2025

Summary

25/08/2023
MEDIUM
Yes i
Medium
Not published

OSV-2023-736: Heap-buffer-overflow in HeifContext::interpret_heif_file. Affects libheif versions >= 6fb8e4cd53619e547be0045ad1615aa429b7f336, < cd6274a9e5e106ea990fb150e781d79848b74337. Fixed in cd6274a9e5e106ea990fb150e781d79848b74337. 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

libheif is an open-source library for reading and writing HEIF (High Efficiency Image Format) image files. It provides functionality to interpret and manipulate HEIF files, allowing developers to integrate HEIF support into their applications. However, a vulnerability has been discovered in the library that can lead to a heap-buffer-overflow when interpreting HEIF files.

Vulnerability Detail

The vulnerability in libheif, specifically in the HeifContext::interpret_heif_file function, allows for a heap-buffer-overflow read of 4 bytes. This can result in a crash when the library attempts to read from memory. The issue was reported through the OSS-Fuzz project and has been assigned a medium severity level. The vulnerability was introduced in commit 6fb8e4cd53619e547be0045ad1615aa429b7f336 of the libheif repository.

How To Fix

Minimum fixed version

cd6274a9e5e106ea990fb150e781d79848b74337

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, developers can consider implementing input validation and sanitization when processing HEIF files. By carefully checking the input data and ensuring it adheres to expected formats and sizes, the risk of triggering the heap-buffer-overflow can be mitigated. However, this is not a definitive solution and should be seen as a temporary measure until the library is updated.

Conclusion

The libheif library is affected by a heap-buffer-overflow vulnerability that can lead to crashes and potential security issues. It is recommended to update the library to a patched version as soon as possible. Developers can check the official repository for updates and follow the provided upgrade process. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for libheif →

Share this vulnerability

FAQ

libheif is an open-source library for reading and writing HEIF image files. It provides functionality to interpret and manipulate HEIF files.

A heap-buffer-overflow occurs when a program attempts to read or write data outside the bounds of a buffer allocated in the heap. In this case, the vulnerability allows for a read of 4 bytes beyond the allocated buffer.

The heap-buffer-overflow vulnerability in libheif can lead to a crash when processing malicious or specially crafted HEIF files. It may also be possible for an attacker to exploit this vulnerability to execute arbitrary code or trigger other security issues.

This vulnerability was discovered through the OSS-Fuzz project, which performs continuous fuzz testing on open-source software. The issue was reported and subsequently investigated by the libheif maintainers.

The vulnerability has been assigned a medium severity level, indicating a moderate level of risk. While it is not considered critical, it should still be addressed to prevent potential security issues.

Related vulnerabilities

Recent vulnerabilities recorded for libheif.

How To Fix

Minimum fixed version

cd6274a9e5e106ea990fb150e781d79848b74337

This is the first release that contains the fix.

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