Out-of-Bounds Access Vulnerability in libarchive Package
Summary
CVE-2024-48958: execute_filter_delta in archive_read_support_format_rar.c in libarchive before 3.7.5 allows out-of-bounds access via a crafted archive file because src can move beyond dst. Affects libarchive across 2 version ranges.
< 3.7.5-r0
>= 9147def1da7ad1bdd47b3559eb1bfeeb0e0f374b, < 12ecf8418ab3595d66cdea1abadcea8b6a9d288b
Fixed in 3.7.5-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 that provides a flexible and efficient way to read and write various archive formats, including tar, zip, and rar. It is integral to many applications and systems that require file compression and decompression functionalities. The library is known for its ability to handle multiple formats seamlessly, making it a popular choice among developers. However, vulnerabilities in libarchive can lead to severe security risks, particularly when processing crafted archive files that may exploit weaknesses in the library's code.
Vulnerability Detail
The vulnerability identified as CVE-2024-48958 arises from the execute_filter_delta function in the archive_read_support_format_rar.c file of libarchive versions prior to 3.7.5. This flaw allows for out-of-bounds access, which can occur when the source pointer (src) moves beyond the destination pointer (dst) during the processing of a specially crafted RAR archive file. The potential ramifications of this vulnerability include unauthorized access to memory, leading to application crashes, data corruption, or even arbitrary code execution, depending on the attacker's intent and the context in which the library is used.
How To Fix
Minimum fixed version
3.7.5-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
As a temporary workaround, users can avoid processing untrusted or crafted RAR archive files until the library is updated. Additionally, implementing strict validation checks on the input files can help mitigate the risk of exploitation.
Conclusion
The CVE-2024-48958 vulnerability in the libarchive package poses significant security risks due to its potential for out-of-bounds memory access. It is essential for users and developers to update to the patched version of the library to safeguard their applications. Additionally, utilizing tools like Vulert can help monitor and manage vulnerabilities effectively.
See every vulnerability recorded for libarchive →
FAQ
CVE-2024-48958 is a security vulnerability in the libarchive library that allows for out-of-bounds memory access when processing crafted RAR archive files.
You can check if your application is affected by using the Vulert playground at Vulert Scanner, which allows you to monitor and alert for open-source vulnerabilities without requiring installation.
The risks include application crashes, data corruption, and potential arbitrary code execution, which can compromise the security of the system using the library.
You can update libarchive by running 'sudo apt update' followed by 'sudo apt install libarchive-dev' in your terminal to ensure you have the patched version.
Yes, avoid processing untrusted RAR files and implement strict validation checks on input files as a temporary measure until the library is updated.
References
Related vulnerabilities
Recent vulnerabilities recorded for libarchive.