Out-of-Bounds Access Vulnerability in libarchive: CVE-2024-48957
Summary
CVE-2024-48957: execute_filter_audio 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 for reading and writing various archive formats, including tar, zip, and rar. It provides a consistent interface for handling compressed files and is utilized in many applications across different platforms. The library's functionality allows developers to easily integrate archive handling capabilities into their software. However, vulnerabilities in libarchive can lead to severe security risks, particularly when processing untrusted archive files.
Vulnerability Detail
CVE-2024-48957 is a critical vulnerability found in the execute_filter_audio function within the archive_read_support_format_rar.c file of libarchive versions prior to 3.7.5. This vulnerability allows for out-of-bounds access, which can occur when a crafted archive file is processed. The src pointer can move beyond the dst buffer, potentially leading to memory corruption, crashes, or execution of arbitrary code. Attackers can exploit this vulnerability by crafting malicious archive files that, when opened, can compromise the integrity and security of the system.
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
If updating the package is not immediately possible, consider avoiding the use of libarchive for processing untrusted or unknown archive files until the library can be updated. Additionally, implement strict validation and sanitization of input files to reduce the risk of exploitation.
Conclusion
CVE-2024-48957 is a significant vulnerability in the libarchive library that can lead to severe security risks if not addressed. It is crucial for users and developers to update to the latest version of libarchive to protect their applications from potential exploitation. Additionally, utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.
See every vulnerability recorded for libarchive →
FAQ
CVE-2024-48957 is a vulnerability in the libarchive library that allows for out-of-bounds access, potentially leading to memory corruption or arbitrary code execution.
All versions of libarchive prior to 3.7.5 are affected by this vulnerability.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected by CVE-2024-48957.
If an immediate update is not possible, avoid processing untrusted archive files and implement input validation to mitigate risks.
Yes, Vulert provides a solution that uses a manifest file like package-lock.json to monitor and alert for vulnerabilities in real-time without requiring code access.
References
Related vulnerabilities
Recent vulnerabilities recorded for libarchive.