Use-After-Free Vulnerability in libarchive: CVE-2019-18408
Summary
ALPINE-CVE-2019-18408: archive_read_format_rar_read_data in archive_read_support_format_rar.c in libarchive before 3.4.0 has a use-after-free in a certain ARCHIVE_FAILED situation, related to Ppmd7_DecodeSymbol. Affects libarchive versions < 3.3.3-r1. Fixed in 3.3.3-r1. 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 streaming archive formats, including tar, cpio, zip, and rar. It provides a flexible and efficient way to handle various archive formats, making it a crucial component in many software applications. However, a vulnerability has been identified in libarchive that could lead to serious security issues if not addressed.
Vulnerability Detail
The vulnerability, identified as CVE-2019-18408, arises from a use-after-free condition in the function archive_read_format_rar_read_data within the file archive_read_support_format_rar.c. This issue occurs in certain scenarios where the function encounters an ARCHIVE_FAILED situation, specifically related to the Ppmd7_DecodeSymbol function. If exploited, this vulnerability could allow an attacker to execute arbitrary code, potentially compromising the integrity and confidentiality of the affected system. The CVSS score for this vulnerability is 7.5, indicating a high severity level.
How To Fix
Minimum fixed version
3.3.3-r1
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
As a temporary workaround, users can avoid processing RAR files until the library is updated to a secure version. This will mitigate the risk of exploitation until a proper fix is applied.
Conclusion
The CVE-2019-18408 vulnerability in libarchive presents a serious security risk due to a use-after-free condition that can lead to arbitrary code execution. It is crucial for users to update their libarchive package to the latest patched version to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for libarchive →
FAQ
CVE-2019-18408 is a security vulnerability in the libarchive library that allows for a use-after-free condition, which could lead to arbitrary code execution.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The CVSS score for CVE-2019-18408 is 7.5, indicating a high severity level.
You can update libarchive on Alpine Linux by running 'apk update' followed by 'apk upgrade libarchive' to ensure you have the patched version.
While specific exploits may not be publicly disclosed, the nature of the vulnerability suggests that it could be exploited to execute arbitrary code, posing a significant risk.
References
Related vulnerabilities
Recent vulnerabilities recorded for libarchive.