PHP2Shell: Read our blog on the critical RCE vulnerabilities affecting 70% of the Internet

CVE-2026-57432: 
NixOS vulnerability analysis and mitigation

Overview

CVE-2026-57432 is an integer overflow vulnerability in Perl's S_measure_struct function that leads to an out-of-bounds heap read in the pack and unpack built-in functions. It affects all Perl versions through 5.43.10 and was disclosed on July 13, 2026, by the CPAN Security Group (CPANSec) via the oss-security mailing list. The fix is included in Perl 5.43.11. It carries a CVSS v3.1 base score of 8.4 (High) (GitHub Advisory, Openwall).

Technical details

The root cause is a missing overflow check in S_measure_struct (in pp_pack.c), classified as CWE-190 (Integer Overflow or Wraparound) and CWE-125 (Out-of-bounds Read). The function accumulates each template item's size * repeat_count into a signed SSize_t total without bounds checking; a sufficiently large repeat count causes the total to wrap to a negative value. The @, X, and x position codes in pack/unpack templates use a signed length comparison to guard buffer pointer movement, which incorrectly passes when the total is negative, advancing the pointer past the end of the allocated heap buffer. Two upstream patches address this: the first adds explicit overflow detection before the accumulation step and raises a fatal exception (croak), while the second fixes additional potential overflows in the B/b and H/h format character length calculations (Perl Patch 1, Perl Patch 2).

Impact

Successful exploitation allows an unprivileged local attacker to read arbitrary heap memory beyond the intended buffer and have that data returned to the caller, resulting in high confidentiality impact. Because the out-of-bounds read can corrupt internal state or be chained with other primitives, integrity and availability are also rated High in the CVSS scoring. The primary risk is sensitive data disclosure — such as cryptographic keys, credentials, or other in-memory secrets — from the affected Perl process; lateral movement potential depends on what data the process holds in memory (GitHub Advisory, Openwall).

Exploitability

No public proof-of-concept exploit code is known to exist, and there is no evidence of in-the-wild exploitation as of the time of disclosure (GitHub Advisory). The NVD SSVC assessment classifies exploitation as "none" and the attack as non-automatable. The EPSS score is approximately 0.207% (9th percentile), indicating a low near-term exploitation probability. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. No threat actor attribution has been reported.

Exploitation steps

  1. Identify a target: Locate a system or application that runs Perl ≤ 5.43.10 and passes attacker-controlled data as a pack or unpack template (e.g., a web application, daemon, or script that accepts user-supplied format strings).
  2. Craft a malicious template: Construct a pack/unpack template string containing a format character (e.g., A, N, C) followed by an extremely large repeat count — large enough that size * repeat_count overflows a signed SSize_t and wraps to a negative value (e.g., "A" . (2**62) . "@0").
  3. Trigger the overflow: Submit the crafted template to the vulnerable Perl code path. S_measure_struct accumulates the overflowed total without detecting the wrap, resulting in a negative total.
  4. Bypass bounds check: The @, X, or x position codes perform a signed comparison against the negative total, which passes incorrectly, advancing the internal buffer pointer past the end of the allocated heap region.
  5. Retrieve heap data: The unpack call returns the out-of-bounds heap bytes to the caller as a Perl string, potentially exposing sensitive in-memory data such as keys, tokens, or other process secrets (Openwall, Perl Patch 1).

Indicators of compromise

  • Logs: Application or system logs showing Perl fatal errors such as Pack template structure size is too large (introduced by the patch) may indicate attempted exploitation against a patched system; absence of such errors on an unpatched system does not rule out exploitation.
  • Process Behavior: Unexpected or anomalous output from Perl scripts that use pack/unpack, particularly binary garbage or memory-like content returned to callers or written to logs/network sockets.
  • Network: If the vulnerable Perl process is network-facing, unusual binary data in HTTP responses or other protocol outputs that appears to contain heap memory artifacts (e.g., embedded pointers, strings from unrelated allocations).
  • File System: Unexpected files written by Perl processes containing binary data that may represent exfiltrated heap contents.

Mitigation and workarounds

The fix is included in Perl 5.43.11 (development release); users should upgrade to this version or any subsequent stable release that incorporates the two upstream patches (Openwall). Red Hat has issued an errata (RHSA-2026:39997) for affected RHEL packages. As a workaround, avoid passing untrusted or user-controlled data as pack/unpack templates; validate and sanitize any template strings to reject excessively large repeat counts before processing. Restricting Perl script execution to trusted sources and applying OS-level mitigations (e.g., ASLR) can reduce the practical impact until patching is possible.

Community reactions

The vulnerability was responsibly disclosed by Stig Palmquist on behalf of the CPAN Security Group (CPANSec) to the oss-security mailing list on July 13, 2026, with patches authored by Paul "LeoNerd" Evans (Openwall). Discussion appeared on the Perl 5 Porters mailing list in both June and July 2026, indicating the issue was tracked internally before public disclosure. Coverage was picked up by security aggregators and the Yocto Project security list, and Perl 5.44's release (which includes the fix) received broader press coverage noting the new named function parameters feature alongside the security fix (Heise).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

perl: 5.36.0-7+deb12u4

Fixed

sid

perl: 5.40.1-8

Fixed

trixie

perl: 5.40.1-6+deb13u1

Fixed

Ubuntu

Fixed

bionic (esm-infra)

perl: 5.26.1-6ubuntu0.7+esm3

Fixed

devel

perl

Not Affected

focal (esm-infra)

perl: 5.30.0-9ubuntu0.5+esm3

Fixed

jammy

perl: 5.34.0-3ubuntu1.8

Fixed

noble

perl: 5.38.2-3.2ubuntu0.4

Fixed

resolute

perl: 5.40.1-7ubuntu0.3

Fixed

trusty (esm-infra-legacy)

perl: 5.18.2-2ubuntu1.7+esm8

Fixed

xenial (esm-infra-legacy)

perl: 5.22.1-9ubuntu0.9+esm3

Fixed

RHEL / CentOS

Affected

OpenShift

openshift/ose-rhel-coreos-8

Affected

RHEL 8

perl.src

Affected

RHEL 9

perl.src

Affected

RHEL 10

perl.src

Affected

Source: This report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-112940HIGH7.1
  • Python logoPython
  • py3-filelock
NoYesOct 20, 2026
CVE-2026-112937MEDIUM6.1
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112936MEDIUM6.1
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112939MEDIUM4.7
  • Python logoPython
  • python-filelock
NoYesOct 20, 2026
CVE-2026-112941LOW3.3
  • Python logoPython
  • filelock
NoYesOct 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management