Heap-Based Buffer Overflow in libarchive: CVE-2016-1541

libarchive Updated 02 Oct 2025

Summary

07/05/2016
N/A
Yes i
High
8.8

ALPINE-CVE-2016-1541: Heap-based buffer overflow in the zip_read_mac_metadata function in archive_read_support_format_zip.c in libarchive before 3.2.0 allows remote attackers to execute arbitrary code via crafted entry-size values in a ZIP ar... Affects libarchive versions < 3.2.0-r0. Fixed in 3.2.0-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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libarchive is a widely used library that provides a flexible and efficient way to read and write various archive formats, including ZIP, TAR, and others. It is designed to handle different types of file archives seamlessly, making it a crucial component in many software applications. However, prior to version 3.2.0, libarchive was susceptible to a serious vulnerability that could allow attackers to exploit the library through crafted ZIP files.

Vulnerability Detail

The vulnerability, identified as CVE-2016-1541, is a heap-based buffer overflow that occurs in the zip_read_mac_metadata function within the archive_read_support_format_zip.c file of libarchive versions before 3.2.0. This flaw allows remote attackers to execute arbitrary code on the affected system by supplying specially crafted entry-size values in a ZIP archive. The potential ramifications include unauthorized access, data corruption, and complete system compromise, making it a critical security issue.

How To Fix

Minimum fixed version

3.2.0-r0

This is the first release that contains the fix.

sudo apk add --upgrade libarchive

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

Workaround

If immediate patching is not feasible, consider avoiding the use of libarchive for processing untrusted ZIP files until the library is updated. Additionally, implement strict input validation to mitigate the risk of exploitation.

Conclusion

CVE-2016-1541 represents a significant security risk for applications utilizing libarchive versions prior to 3.2.0. It is crucial for developers and system administrators to update to the patched version to safeguard against potential exploits. Utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.

See every vulnerability recorded for libarchive →

Share this vulnerability

FAQ

CVE-2016-1541 is a vulnerability in libarchive that allows remote attackers to execute arbitrary code via crafted ZIP files due to a heap-based buffer overflow.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which allows you to monitor for open-source vulnerabilities without requiring any signup.

The CVSS score for CVE-2016-1541 is 8.8, indicating a high severity level.

If you cannot update libarchive right away, avoid processing untrusted ZIP files and implement strict input validation as a temporary measure.

More information about libarchive can be found on its official website or through its documentation, which provides insights into its features and usage.

Related vulnerabilities

Recent vulnerabilities recorded for libarchive.

How To Fix

Minimum fixed version

3.2.0-r0

This is the first release that contains the fix.

sudo apk add --upgrade libarchive

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