An Out-of-bounds (OOB) Read Vulnerability has been discovered in the libjxl library. The vulnerability could be exploited by a threat actor using a specially crafted file that targets the Exif (Exchangeable image file format) handler. The following content aims to provide a detailed breakdown of the vulnerability, including the affected code snippet, relevant links to original references, and specific exploit information.
The vulnerability is identified as CVE-2023-0645 and primarily affects JPEG XL image codec (a new format aimed at significantly improving image quality while offering better compression) that is being actively developed by the JPEG Committee.
Code Snippet
The vulnerability arises from an out-of-bounds read that occurs in the libjxl Exif Handler. The affected code snippet can be found in the following file:
libjxl/exif.cc
The specific problematic logic responsible for the OOB read is
ExifData ExifParser::ParseFromJXL(size_t num_bytes_read) {
...
ExifData data = Parse(num_bytes_read);
...
}
Exploit Details
An attacker could exploit this vulnerability by creating a malicious JPEG XL image file containing specially crafted Exif metadata designed to trigger an out-of-bounds read in libjxl's Exif parser. Upon the targeted system processing the malicious file, the attacker could cause a denial of service (DoS), crash the application, or potentially further exploit the system.
References and Solution
The vulnerability was analyzed and patches were provided by libjxl developers. To mitigate the possible impact of this vulnerability on your system, it is recommended to upgrade libjxl to version .8.1 or apply the patches provided in the following two commits:
1. d95b050c1822a5b1ede9edc937e43fca1b10159
2. https://github.com/libjxl/libjxl/pull/2111
Upgrading to libjxl version .8.1 or applying the patches ensures that the out-of-bounds read is correctly handled without causing any adverse effects on the system.
In conclusion, paying attention to such vulnerabilities and applying the recommended patches is crucial for the smooth functioning and safety of your systems. By staying informed and taking prompt action, you can reduce the risk of possible exploits and keep your data and systems safe from malicious activities.
Timeline
Published on: 04/11/2023 14:15:00 UTC
Last modified on: 04/18/2023 18:27:00 UTC