Integer Overflow Vulnerability in libarchive: Remote Code Execution Risk
Summary
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 ↓
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.
No signup required · Results in about 60 seconds
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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for libarchive.