CVE-2026-58586
Executive Summary
CVE-2026-58586 exposes a critical supply chain risk in the Perl ecosystem. The Image::WebP module (versions through 0.2) bundles a statically linked copy of libwebp version 0.3.0, released in March 2013. This ancient library contains multiple known vulnerabilities, most notably CVE-2023-4863 (a heap buffer overflow in WebP lossless decoding). Because the vulnerable library is compiled into the module, upgrading the system-wide libwebp does NOT remediate the issue. Any application or service that uses Image::WebP to decode untrusted WebP images is at risk of remote code execution, denial of service, or information disclosure. The EPSS score is 0.0% as no public exploit is available, but the underlying vulnerability in libwebp is well-known and actively exploited in other contexts.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This is a classic software supply chain issue. The Perl module Image::WebP is distributed via CPAN (Comprehensive Perl Archive Network). Users who install it via cpan or cpanm receive a tarball that includes the vulnerable libwebp source code. The build process (Makefile.PL) compiles and statically links this bundled library, bypassing any system-provided libwebp. The dependency is deeply embedded: even if the developer updates the system libwebp to a patched version, the Perl module remains vulnerable. The module maintainer has not released a patched version that uses a modern, secure libwebp (e.g., 1.3.2+). This makes every deployment of Image::WebP a ticking bomb.
CVSS Breakdown & Threat Level
No CVSS vector has been officially assigned. However, based on the bundled vulnerability (CVE-2023-4863, CVSS 8.8 – High), we can estimate the risk as:
- Attack Vector: Network (via malicious WebP image)
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required (victim loads the image)
- Scope: Unchanged
- Confidentiality: High
- Integrity: High
- Availability: High
Estimated CVSS Base Score: 8.8 (High)
Given that the vulnerable library is statically linked and no workaround exists (except not using the module), the overall threat level for any organization using Image::WebP is Critical.
Deep Dive & Mechanics
The core flaw is not a new vulnerability in libwebp itself, but the inclusion of an outdated, unmaintained version that is known to be exploitable. The bundled libwebp 0.3.0 contains at least the following known CVEs:
- CVE-2023-4863: Heap buffer overflow in
WebPlossless decoder, allows arbitrary code execution via a crafted WebP image. - Other older vulnerabilities (e.g., CVE-2018-25010, CVE-2020-36433) related to memory corruption.
The attack surface is triggered whenever Image::WebP functions like decode or load are called on a user-supplied WebP file. The bundled decoder does not benefit from security patches applied to the system libwebp because it is statically linked. This is a classic case of "dependency confusion" where the developer intended to avoid version conflicts but created a security blind spot.
Attackers can exploit this by sending a malicious WebP image to any endpoint that uses Image::WebP for processing (e.g., image upload, thumbnail generation, avatar processing).
Vulnerable vs. Patched Code
No patched version of Image::WebP exists at this time. The maintainer must:
- Remove the bundled
libwebpsource. - Link dynamically against a system
libwebp>= 1.3.2 (which fixes CVE-2023-4863). - Or update the bundled copy to at least libwebp 1.3.2 and re-release.
Example of static link detection:
# Vulnerable: bundled, static libwebp
use Image::WebP;
my $img = Image::WebP->new;
$img->decode($malicious_data); # calls vulnerable decoder
Patched version (hypothetical):
# After fix: dynamic link to system libwebp
# Ensure system has libwebp >= 1.3.2 installed
use Image::WebP;
# No static linking, uses system library
Until a patched version is released, the only remediation is to avoid using Image::WebP and switch to alternative Perl WebP modules (e.g., GD::WebP or Imager::WebP) that use the system library correctly.
Exploitation & Lab Setup
No public exploit code or Nuclei template is available. The following is a conceptual approach.
Red Team – Exploitation
- Craft malicious WebP: Use a known proof-of-concept for CVE-2023-4863 (heap overflow) targeting
libwebp0.3.0. Tools likewebp-exploit(hypothetical) can generate a payload that triggers a controlled crash or remote code execution. - Deliver to vulnerable endpoint: Upload the crafted image to a web application that uses
Image::WebPfor resizing or thumbnail generation. - Achieve code execution: The heap overflow allows overwriting a function pointer or other critical data, leading to arbitrary code execution in the context of the web server (e.g., Perl interpreter).
Sample code to test (safety: do not run in production):
use Image::WebP;
my $malicious = read_binary('crafted.webp');
my $img = Image::WebP->new;
eval { $img->decode($malicious) };
if ($@) {
print "Exploit may have triggered: $@\n";
}
Blue Team – Detection & Mitigation
- Asset Identification: Scan all Perl applications to find modules using
Image::WebP. Run:grep -r "use Image::WebP" /path/to/project - Patch System: Although system libwebp does not help, ensure you are prepared for a future fix by having libwebp 1.3.2+ installed.
- Monitor for exploitation: Look for WebP files that trigger unusual memory allocation patterns or cause Perl to crash.
- WAF/IDS Rules: Create Suricata rules (see below) to detect potential malicious WebP images in transit.
- Harden Input Validation: Reject WebP uploads if possible, or convert to a safe format (PNG/JPEG) with a different library.
Indicators of Compromise (IOCs)
- File Hashes (of vulnerable bundled libwebp 0.3.0):
sha256: a3c1e2c3b4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f- (Note: actual hash depends on distribution; scan for
libwebp-0.3.0.tar.gz)
- Perl Module Version:
Image::WebPversion <= 0.2 - Network Behavior: Unusually large or structurally malformed WebP images uploaded to web endpoints (might be an indicator of exploitation attempts).
- Crash Dumps: Segfaults in Perl process related to
Image::WebPdecoding.
Detection Engineering
YARA Rule
rule CVE_2026_58586_bundled_libwebp
{
meta:
description = "Detect static linked libwebp 0.3.0 in Perl module Image::WebP"
author = "Valters IT"
date = "2025-04-07"
hash = "sha256"
strings:
$libwebp_version = "0.3.0" wide ascii
$libwebp_constant = "WebPDecode" ascii
$perl_module = "Image::WebP" ascii
condition:
($libwebp_version and $libwebp_constant) or ($perl_module and $libwebp_constant)
}
Sigma Rule
title: CVE-2026-58586 – Image::WebP Bundled Vulnerable libwebp
id: abcd1234-5678-90ab-cdef-1234567890ab
status: experimental
description: Detects attempts to use Image::WebP with bundled libwebp 0.3.0
author: Valters IT
date: 2025/04/07
logsource:
category: process_creation
product: windows
service: process
detection:
selection:
Image|endswith: '\perl.exe'
CommandLine|contains: 'Image::WebP'
condition: selection
falsepositives:
- Legitimate use of the vulnerable module (no patch available)
level: high
tags:
- attack.initial_access
- cve.2026.58586
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2026-58586 - Potential malicious WebP upload targeting Image::WebP"; flow:to_server,established; content:"webp"; nocase; pcre:"/^RIFF.{4}WEBP/i"; file.data; classtype:attempted-exploit; sid:20260001; rev:1;)
Note: The Suricata rule matches HTTP traffic containing WebP magic bytes (RIFF....WEBP) in file uploads. It is a generic detection for any WebP transfer, not specific to the vulnerability. Tune with environment.
Remediation & Mitigation
- Immediate: Identify all systems using
Image::WebP. If possible, remove the module and replace it with an alternative (e.g.,Imager::WebPthat uses systemlibwebpviaImager’s plugin). - Short-term: If removal is not feasible, restrict WebP image uploads from untrusted sources. Perform server-side validation and conversion to a safe format using a different library.
- Long-term: Contact the module maintainer and demand a new release that either:
- Links dynamically against the system
libwebp, or - Bundles a patched version (>= 1.3.2).
- Links dynamically against the system
- Monitor CVE databases for future updates to
Image::WebP. Subscribe to Perl security advisories. - Defense in depth: Use web application firewalls (WAF) to inspect uploaded images for malicious content. Deploy endpoint detection rules (YARA, Sigma) to spot exploitation attempts.
No existing patch is available. The software must be considered end-of-life for security purposes until the maintainer addresses the bundling issue.
This report was generated by an automated system for Valters IT. For questions, contact your security team.