Integer Overflow Vulnerability in libarchive: Remote Code Execution Risk

libarchive Updated 02 Oct 2025

Summary

21/09/2016
N/A
Yes i
High
7.8

ALPINE-CVE-2016-4300: Integer overflow in the read_SubStreamsInfo function in archive_read_support_format_7zip.c in libarchive before 3.2.1 allows remote attackers to execute arbitrary code via a 7zip file with a large number of substreams, w... Affects libarchive versions < 3.2.1-r0. Fixed in 3.2.1-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

libarchive is a widely used library for reading and writing various archive formats, including tar, zip, and 7zip. It provides a flexible API for developers to manage compressed files and is integral to many applications that require file archiving capabilities. However, prior to version 3.2.1, libarchive was susceptible to an integer overflow vulnerability that could be exploited through specially crafted 7zip files.

Vulnerability Detail

The vulnerability arises from an integer overflow in the read_SubStreamsInfo function within archive_read_support_format_7zip.c in libarchive versions before 3.2.1. Attackers can exploit this flaw by crafting a 7zip file with a large number of substreams, leading to a heap-based buffer overflow. This can result in remote code execution, allowing attackers to execute arbitrary code on the affected system, posing significant security risks.

How To Fix

Minimum fixed version

3.2.1-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 you are unable to update libarchive immediately, consider restricting access to the affected application or service until the update can be applied. Additionally, avoid processing untrusted 7zip files to minimize the risk of exploitation.

Conclusion

The integer overflow vulnerability in libarchive poses a significant risk of remote code execution through specially crafted 7zip files. It is crucial to update to the patched version 3.2.1-r0 or later to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor and manage vulnerabilities in your software dependencies effectively.

See every vulnerability recorded for libarchive →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 7.8, indicating a high severity level.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Exploitation of this vulnerability can lead to remote code execution, allowing attackers to gain control over the affected system.

Yes, Vulert can monitor and alert you in real-time for open-source vulnerabilities in your software using just a manifest file like package-lock.json.

If an immediate update is not possible, restrict access to the affected application and avoid processing untrusted 7zip files.

Related vulnerabilities

Recent vulnerabilities recorded for libarchive.

How To Fix

Minimum fixed version

3.2.1-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