Apr 2, 2026·7 min read·156 visits
Perl's core Compress::Raw::Zlib module uses an outdated zlib library, enabling heap-based buffer overflows and race conditions that lead to remote code execution and denial of service.
CVE-2026-4176 is a critical dependency chain vulnerability in the Perl programming language. It is caused by the inclusion of an outdated version of the Compress::Raw::Zlib core module, which bundles a vulnerable version of the zlib compression library. This exposure allows unauthenticated remote attackers to achieve arbitrary code execution or denial of service via malformed compressed data streams.
CVE-2026-4176 represents a critical supply chain vulnerability within the core distribution of the Perl programming language. The flaw originates from the inclusion of an outdated, vulnerable version of the Compress::Raw::Zlib dual-life core module. This module vendors a vulnerable iteration of the widely used zlib compression library, specifically versions prior to 1.3.2.
The vulnerability is classified under CWE-1395 as a dependency chain flaw. It effectively exposes Perl applications to severe underlying memory safety issues, including CVE-2026-3381 and CVE-2026-27171. Applications that process untrusted compressed data streams using native Perl core modules are inherently at risk.
Depending on the specific application logic and execution environment, exploitation can result in remote code execution, heap memory corruption, or sustained denial of service conditions. The vulnerability carries a maximum CVSS v3.1 score of 9.8, reflecting the zero-click, unauthenticated nature of the exposure across network boundaries.
The primary technical defect resides in how legacy zlib handles memory allocation for large compressed payloads. The library historically utilized the uLong data type to define and track buffer lengths. On many target architectures, uLong resolves to a 32-bit integer, imposing a strict maximum value that fails to account for modern, large-scale data streams.
When an application processes data payloads exceeding four gigabytes, or when boundary calculations for maximum buffer sizes operate on extreme inputs, integer overflow conditions arise. The compressBound function is specifically vulnerable; an overflow during the calculation phase causes the function to return a bound value substantially smaller than the actual input size.
Subsequent memory allocation routines rely on this erroneously small bound. When the compression routine executes, it writes data past the allocated boundary, triggering a classic heap-based buffer overflow. This memory corruption disrupts heap management structures, creating conditions favorable for arbitrary code execution if subsequent allocations overlap with attacker-controlled data.
A secondary race condition exacerbates the module's instability in multi-threaded execution environments. The vendored zlib code implements dynamic CRC table initialization using a non-atomic "test and set" mechanism. Concurrent threads executing the initialization routine can corrupt the crc_table state, yielding non-deterministic crashes or exploitable memory states.
The remediation applied to the Perl core repository resolves these flaws by introducing modern type definitions and atomic thread-safety primitives. The patch is documented in commit c75ae9cc164205e1b6d6dbd57bd2c65c8593fe94. The core of the integer overflow fix involves migrating buffer length calculations from 32-bit types to the 64-bit z_size_t structure.
// VULNERABLE CODE - Legacy 32-bit bounds calculation
uLong ZEXPORT compressBound(uLong sourceLen) {
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
}The patched implementation explicitly monitors for overflow conditions during the calculation phase. If an overflow is detected, the function reliably returns an error state (-1) rather than a truncated, dangerous buffer size. This prevents the downstream heap allocation routine from creating an undersized buffer.
// PATCHED CODE - Explicit overflow validation and 64-bit types
z_size_t ZEXPORT compressBound_z(z_size_t sourceLen) {
z_size_t bound = sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
(sourceLen >> 25) + 13;
return bound < sourceLen ? (z_size_t)-1 : bound;
}The patch simultaneously resolves the multi-threading race condition by introducing a z_once synchronization primitive. This guarantees that make_crc_table executes exactly once, regardless of concurrent execution threads, preventing state corruption during parallel processing routines.
// PATCHED CODE - Thread-safe initialization
local z_once_t made = Z_ONCE_INIT;
const z_crc_t FAR * ZEXPORT get_crc_table(void) {
#ifdef DYNAMIC_CRC_TABLE
z_once(&made, make_crc_table);
#endif
return (const z_crc_t FAR *)crc_table;
}Exploitation of CVE-2026-4176 requires an attacker to transmit a malformed or extensively large compressed data stream to a vulnerable Perl application. The target must process this input using the affected Compress::Raw::Zlib library or a dependent wrapper module such as IO::Compress::Gzip.
The attacker begins by identifying an input vector that directly feeds into the compression or decompression routines. Common vectors include web applications handling uploaded archives, IMAP servers processing compressed email attachments, or data pipelines executing inline decompression. The input must exceed the integer bounds or trigger the specific boundary calculations documented in the root cause analysis.
To achieve code execution, the attacker structures the payload to ensure the truncated allocation overlays critical heap structures. By controlling the data written past the allocated buffer, the attacker overwrites function pointers or heap allocation metadata. Modern exploit mitigations such as ASLR and DEP complicate this phase, often requiring a secondary information leak vulnerability to resolve memory addresses reliably.
Alternatively, the attacker can leverage the multi-threading flaw by issuing highly concurrent requests containing compressed payloads. This technique forces the target application to execute the vulnerable crc_table initialization routine simultaneously across multiple threads. The resulting state corruption provides a probabilistic avenue for memory exploitation or immediate process termination.
The vulnerability exposes unpatched systems to extreme operational risk, reflected in its maximum CVSS base score of 9.8. Successful exploitation grants an unauthenticated, remote attacker complete control over the execution flow of the Perl process. This directly enables arbitrary code execution within the security context of the vulnerable application.
If the application executes with elevated privileges or manages sensitive data streams, the compromise extends to lateral movement capabilities and widespread data exfiltration. The fundamental nature of the zlib library ensures that its inclusion is practically ubiquitous in modern text and data processing applications, vastly expanding the theoretical attack surface.
Furthermore, the flaw documented as CVE-2026-27171 introduces a deterministic denial of service vector. Specific input payloads trigger a tight loop in the x2nmodp function, resulting in exhaustive CPU consumption. An attacker can trivially degrade service availability by submitting multiple concurrent payloads that force the application into this processing loop.
Current threat intelligence indicates a low immediate probability of automated exploitation, with an EPSS score of 0.00019. However, the foundational nature of the vulnerability and the detailed availability of patch data guarantee that threat actors will prioritize reverse engineering the specific heap layouts required for weaponization.
Organizations must immediately audit their Perl installations and deployed applications to identify vulnerable versions of Compress::Raw::Zlib. The primary remediation strategy involves upgrading the core Perl distribution to patched release candidates. The Perl maintainers have released versions 5.40.4, 5.42.2, and 5.43.9 to address the vulnerability completely.
Administrators who cannot perform a complete runtime upgrade must manually update the Compress::Raw::Zlib module via CPAN. Installing version 2.222 or later directly into the local @INC path ensures the interpreter bypasses the vulnerable core module. This operation effectively intercepts the vulnerable dependency chain without requiring a complete binary replacement.
Environments leveraging system-provided Perl distributions (such as Debian, Red Hat, or Alpine Linux) often link against the host operating system's zlib implementation. In these architectures, upgrading the system-level zlib package to version 1.3.2 mitigates the underlying memory corruption and denial of service flaws. Administrators must verify their linkage strategy to confirm this remediation path.
> [!NOTE]
> To verify the currently installed module version, execute the following command: perl -MCompress::Raw::Zlib -e 'print $Compress::Raw::Zlib::VERSION'
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
Perl SHAY | 5.9.4 to < 5.40.4-RC1 | 5.40.4 |
Perl SHAY | 5.41.0 to < 5.42.2-RC1 | 5.42.2 |
Perl SHAY | 5.43.0 to < 5.43.9 | 5.43.9 |
Compress::Raw::Zlib Perl / MetaCPAN | <= 2.219 | 2.222 |
zlib zlib | < 1.3.2 | 1.3.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-1395 |
| Attack Vector | Network |
| CVSS Score | 9.8 |
| EPSS Score | 0.00019 |
| Primary Impact | Remote Code Execution / Denial of Service |
| Exploit Status | None publicly known |
| CISA KEV | Not listed |
A vulnerability caused by relying on a third-party dependency (zlib) that contains unpatched memory safety flaws.
The vibe-trading-ai package prior to version 0.1.7 contains multiple critical security vulnerabilities including unauthenticated remote code execution (RCE) via session message injection, missing authentication on read endpoints, unrestricted file upload, insecure CORS policies, and sensitive key disclosure. Because the application default settings failed open, ran as root within Docker, and bound to all interfaces, remote unauthenticated attackers could compromise host environments containing sensitive trading data.
CVE-2026-18140 is a denial-of-service vulnerability in the Amazon aws-smithy-json Rust crate. Under-validation of recursion depth within the unknown-key skipping path allows a remote, unauthenticated attacker to cause stack exhaustion and process aborts by sending deeply nested JSON arrays.
A sensitive information disclosure vulnerability exists in the Trigger.dev Command Line Interface (CLI) framework. When executing build processes inside CLI v3 packages, the framework's debug deployment logs print unredacted, resolved environment variables and secrets to standard output or log streams. This exposure occurs when the CLI is operated with a high logging verbosity level, enabling any individual or automated system with read access to build logs, CI/CD output consoles, or local development streams to capture plaintext sensitive parameters, such as database credentials, API keys, and private external integration tokens.
CVE-2026-104855 is a critical vulnerability involving a race condition and reentrant state desynchronization within Wasmtime, a standalone WebAssembly runtime. Due to incremental mid-operation preemption points in compiler-generated loops for bulk memory and table operations, a host-defined epoch or fuel deadline callback could mutate the WebAssembly Store. Upon resuming, the virtual machine utilized stale cached pointers, resulting in use-after-free, out-of-bounds writes, and sandbox escape.
CVE-2026-74802 is a critical Cross-Site WebSocket Hijacking (CSWSH) vulnerability in the SiYuan knowledge workspace application. Due to improper origin validation across multiple internal WebSocket endpoints, an attacker can hijack active authenticated sessions when a victim visits an untrusted external page. This allows the attacker to route malicious network traffic through the victim's localized SiYuan server, establishing an authenticated network pivot and facilitating Server-Side Request Forgery (SSRF).
A high-severity missing authorization vulnerability (CWE-862) exists in the SiYuan note-taking application before v3.7.4. Seventeen block metadata and content-derived endpoints within kernel/api/block.go lack proper publish-access and role-based checks. This allows low-privilege or anonymous users in publish mode to bypass workspace restrictions and disclose private block content, trace workspace structures, map document indexes, and verify the existence of private notes. The vulnerability is addressed in version v3.7.4.