LibWebP, the New Log4j
CVE-2023–4863 Critical CVSS Score 10.0
UPDATE: CVE-2023–5129 has now been rejected and instead is being referred to as its predecessor only, CVE-2023–4863
Originally on Medium: https://medium.com/@penquestr/libwebp-the-new-log4j-3e932b35bdcb
Background
Google has acknowledged a new and severe security flaw in the libwebp image library, which handles the rendering of WebP format images. This vulnerability, identified as CVE-2023–5129, has received the maximum severity score of 10.0 on the CVSS rating scale. The flaw arises from an issue in the Huffman coding algorithm which, with a specially crafted WebP lossless file, can lead to out-of-bounds data writing to the heap. The ReadHuffmanCodes() function and the ReplicateValue area are particularly impacted by this flaw.
This recent development follows after a similar bug was addressed by Apple, Google, and Mozilla, labeled under CVE codes CVE-2023–41064 and CVE-2023–4863. These bugs could lead to arbitrary code execution when dealing with a maliciously crafted image. Both vulnerabilities are believed to be related to the same core problem in the libwebp library. Citizen Lab reports that CVE-2023–41064 was used as part of a zero-click iMessage exploit chain called BLASTPASS to deploy the notorious Pegasus spyware. Further details are still pending.
Interestingly, while CVE-2023–4863 was previously reported as an issue affecting Google Chrome alone, further investigation reveals its impact to be much more widespread (this is now more of a moot point as 4863 has come back to replace 5129). Any application relying on the libwebp library to handle WebP images is potentially vulnerable. Rezillion’s recent analysis disclosed a multitude of widely used applications, libraries, frameworks, and operating systems that could be affected by CVE-2023–4863. They emphasized the efficiency of libwebp in comparison to JPEG and PNG in terms of size and speed. Given its widespread adoption, this vulnerability presents significant concerns for users and organizations alike.
As a part of their response, Google has expanded its fix for CVE-2023–4863 to include both the Stable channel for ChromeOS and ChromeOS Flex with the latest version release.
Comparison with the Log4j/Log4Shell Incident:
The described vulnerability in the libwebp image library draws parallels to the widely-publicized Log4j/Log4Shell incident from late 2021. Here’s how the two are reminiscent of each other:
1. Widespread Usage: Much like the Log4j library, which was integral to many Java-based applications, the libwebp library is foundational for rendering WebP format images. Its ubiquity amplifies the risk, as a significant portion of software in circulation could be affected.
2. High Severity Scores: Both vulnerabilities were designated with high severity scores on the CVSS scale. The Log4j flaw, known as CVE-2021–44228 or “Log4Shell”, was similarly given a score of 10.0, reflecting its critical nature.
3. Broad Attack Surface: Just as the Log4j vulnerability allowed attackers to remotely execute arbitrary code on vulnerable servers, the flaw in libwebp permits maliciously crafted files to write data out of bounds. The repercussions can be profound, potentially leading to unauthorized access, data breaches, and other malicious activities.
4. Misconceptions about Affected Platforms: In both cases, initial reports underestimated the extent of the vulnerability’s reach. For CVE-2023–4863, it was initially assumed to affect only Google Chrome, but later it was found to have a more universal impact. Similarly, with Log4Shell, while initial attention was on its implications for web services, it soon became apparent that numerous types of software, were at risk.
5. Rapid Exploitation: Both vulnerabilities saw swift exploitation following their public disclosure. In the case of Log4Shell, malicious actors were quick to launch attacks, scanning and targeting vulnerable servers within hours. It’s implied that CVE-2023–5129 and related flaws have already been exploited in the wild, as indicated by the BLASTPASS chain using the Pegasus spyware.
6. Post-Discovery Action: The aftermath of the discovery of both vulnerabilities saw a rush in the tech community to patch affected systems and software. This response highlights the urgency with which organizations, developers, and vendors treat such high-severity security flaws.
In essence, the libwebp vulnerability shares the hallmarks of the Log4j/Log4Shell incident. Don’t be surprised if the list of affected software grows.
Complete List of Affected Software (will keep this up to date)
Browsers and Software Updated with Patches for CVE-2023–4863:
Operating Systems with Updates or Partial Fixes for CVE-2023–4863:
Github Repo Including over 700 Applications
https://gist.github.com/mttaggart/02ed50c03c8283f4c343c3032dd2e7ec
Technical Recommendations for Addressing LibWebP (Some of these are intrusive to operations)
1. Disable WebP at Firewall Level:
领英推荐
2. Intrusion Detection & Prevention:
3. Web Content Filtering:
4. Network Segmentation:
5. Patch Management:
6. Endpoint Protection:
7. Secure Configurations:
Basic Guide for Affected Organizations:
2. Software Inventory:
3. Patching:
4. Monitoring and Reporting:
5. Backup:
6. Educate & Train:
7. Stay Informed: