CVE-2026-57432
Analyzed Analyzed - Analysis Complete

Integer Overflow in Perl pack/unpack Leading to Heap Out-of-Bounds Read

Vulnerability report for CVE-2026-57432, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-13

Last updated on: 2026-07-14

Assigner: CPANSec

Description

Perl versions through 5.43.10 have an integer overflow in S_measure_struct leading to an out-of-bounds heap read in pack and unpack. S_measure_struct adds each item's size times its repeat count to a running total with no overflow check, so a large repeat count in a pack or unpack template wraps the signed SSize_t total negative. The @, X, and x position codes then guard their moves with a signed length comparison that passes when the length is negative, advancing the buffer pointer out of bounds. A template derived from untrusted input can read heap memory past the buffer and return it to the caller.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-13
Last Modified
2026-07-14
Generated
2026-08-03
AI Q&A
2026-07-14
EPSS Evaluated
2026-08-01
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
perl perl to 5.43.10 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-125 The product reads data past the end, or before the beginning, of the intended buffer.
CWE-190 The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-57432 is an integer overflow vulnerability in Perl versions through 5.43.10. It occurs in the S_measure_struct function, which is used by the pack and unpack functions.

The vulnerability arises when S_measure_struct calculates a running total of item sizes multiplied by their repeat counts without checking for overflow. If a large repeat count is provided, the signed SSize_t total can wrap around to a negative value.

The @, X, and x position codes in pack and unpack then use a signed length comparison that incorrectly allows negative lengths. This causes the buffer pointer to advance out of bounds, leading to an out-of-bounds heap read.

As a result, a template derived from untrusted input can read memory beyond the allocated buffer and return it to the caller.

Detection Guidance

Detecting this vulnerability requires checking for the presence of affected Perl versions or testing for the specific integer overflow condition in the S_measure_struct function used by pack and unpack.

  • Check the installed Perl version on your system. The vulnerability affects Perl versions through 5.43.10. You can run the following command to check the Perl version: perl -v
  • If the version is 5.43.10 or earlier, the system may be vulnerable. Upgrade to Perl 5.43.11 or later to mitigate the issue.
  • To test for the vulnerability, you can attempt to trigger the integer overflow by using a pack or unpack template with a large repeat count. For example, running a script with a template like 'a99999999999999' (a very large repeat count) may cause unexpected behavior or crashes if the system is vulnerable. However, this should be done in a controlled environment to avoid unintended consequences.

Note that actively testing for the vulnerability may lead to system instability or crashes, so it is recommended to verify the Perl version first and apply patches or upgrades instead.

Impact Analysis

This vulnerability can impact you in several ways:

  • Exposure of sensitive data: An attacker could exploit this vulnerability to read memory beyond the intended buffer, potentially exposing sensitive information stored in memory.
  • Privilege escalation: If the vulnerable Perl script runs with elevated privileges, an attacker might gain access to restricted data or execute unintended actions.
  • System instability: The out-of-bounds read could cause crashes or unpredictable behavior in applications using the affected Perl functions.

The CVSS v3.1 score of 8.4 (High) indicates that this vulnerability is severe, with potential for high impact on confidentiality, integrity, and availability.

Compliance Impact

This vulnerability can affect compliance with common standards and regulations in the following ways:

  • GDPR (General Data Protection Regulation): If the vulnerability leads to unauthorized access to personal data, it could result in a data breach. GDPR requires organizations to implement appropriate security measures to protect personal data and report breaches within 72 hours. Failure to do so could lead to significant fines.
  • HIPAA (Health Insurance Portability and Accountability Act): For organizations handling protected health information (PHI), this vulnerability could lead to unauthorized access to sensitive patient data. HIPAA requires safeguards to ensure the confidentiality, integrity, and availability of PHI. A breach could result in penalties and mandatory corrective actions.
  • Other standards: Many industry-specific standards (e.g., PCI DSS for payment card data) require protection against vulnerabilities that could lead to data exposure. This vulnerability could put organizations out of compliance with such standards, leading to potential fines or loss of certification.

To maintain compliance, organizations should apply the available patches or upgrade to Perl 5.43.11 to mitigate this vulnerability.

Mitigation Strategies
  • Upgrade Perl to version 5.43.11 or later, as the vulnerability has been fixed in this release.
  • If upgrading is not immediately possible, apply the upstream patches provided by the Perl development team. The relevant patches are available in Resource 1 and Resource 2.
  • Resource 1 provides a patch that modifies the calculation of `len` in `S_measure_struct` to prevent integer overflow for large input sizes.
  • Resource 2 provides a patch that adds an overflow check in `pp_pack.c` and throws an exception if the structure size is too large, preventing the out-of-bounds read.
  • Restrict the use of pack and unpack templates derived from untrusted input until the system is patched or upgraded. This reduces the risk of exploitation.
  • Monitor systems for unusual behavior or crashes related to pack and unpack operations, as these may indicate exploitation attempts.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-57432. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart