Critical Divide-by-Zero Vulnerability in libexif Package

libexif Updated 02 Oct 2025

Summary

09/05/2020
N/A
Yes i
Medium
5.5

ALPINE-CVE-2020-12767: exif_entry_get_value in exif-entry.c in libexif 0.6.21 has a divide-by-zero error. Affects libexif versions < 0.6.22-r0. Fixed in 0.6.22-r0. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

libexif is a library used for reading and writing EXIF (Exchangeable Image File Format) metadata in image files. It is widely utilized in various applications that handle image processing and manipulation. The library provides functionalities to extract and modify metadata, making it essential for applications that require image metadata management. However, a vulnerability has been identified in libexif that could lead to severe consequences if exploited.

Vulnerability Detail

The vulnerability, identified as CVE-2020-12767, is a divide-by-zero error in the function exif_entry_get_value located in exif-entry.c of libexif version 0.6.21. This flaw can be exploited by attackers to cause a denial of service (DoS) by crashing the application that utilizes this library. The divide-by-zero error occurs when the code attempts to perform a division operation with a zero denominator, leading to unexpected behavior and potential application crashes. The vulnerability affects multiple versions of the libexif package across various Alpine Linux distributions.

How To Fix

Minimum fixed version

0.6.22-r0

This is the first release that contains the fix.

sudo apk add --upgrade libexif

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

Workaround

If updating the package is not immediately feasible, consider implementing input validation to prevent the application from processing malformed EXIF data that could trigger the divide-by-zero error. Additionally, restricting access to the application or disabling features that utilize libexif may help mitigate the risk temporarily.

Conclusion

The divide-by-zero vulnerability in the libexif package poses a significant risk to applications that rely on this library for image metadata management. It is crucial to update to the patched version 0.6.22-r0 to mitigate the risk of exploitation. Additionally, utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.

See every vulnerability recorded for libexif →

Share this vulnerability

FAQ

CVE-2020-12767 is a vulnerability in the libexif library that causes a divide-by-zero error, potentially leading to application crashes.

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 can lead to a denial of service (DoS), causing the application to crash and become unavailable.

Yes, the patched version of libexif is 0.6.22-r0. Updating to this version will fix the vulnerability.

Vulert monitors and alerts for open-source vulnerabilities in software using a manifest file like package-lock.json, providing real-time insights into potential risks.

Related vulnerabilities

Recent vulnerabilities recorded for libexif.

How To Fix

Minimum fixed version

0.6.22-r0

This is the first release that contains the fix.

sudo apk add --upgrade libexif

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