CyberAlerts is shutting down on June 30th, 2025. Thank you for your support!

CVE-2024-56406: Perl 5.34, 5.36, 5.38 and 5.40 are vulnerable to a heap buffer overflow when transliterating non-ASCII bytes

8.6 CVSS

Description

A heap buffer overflow vulnerability was discovered in Perl.

When there are non-ASCII bytes in the left-hand-side of the `tr` operator, `S_do_trans_invmap` can overflow the destination pointer `d`.

   $ perl -e '$_ = "\x{FF}" x 1000000; tr/\xFF/\x{100}/;'
   Segmentation fault (core dumped)

It is believed that this vulnerability can enable Denial of Service and possibly Code Execution attacks on platforms that lack sufficient defenses.

Classification

CVE ID: CVE-2024-56406

CVSS Base Severity: HIGH

CVSS Base Score: 8.6

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H

Problem Types

CWE-122 Heap-based Buffer Overflow CWE-787 Out-of-bounds Write

Affected Products

Vendor: perl

Product: perl

Exploit Prediction Scoring System (EPSS)

EPSS Score: 0.05% (probability of being exploited)

EPSS Percentile: 16.46% (scored less or equal to compared to others)

EPSS Date: 2025-05-12 (when was this score calculated)

References

https://nvd.nist.gov/vuln/detail/CVE-2024-56406
https://github.com/Perl/perl5/commit/87f42aa0e0096e9a346c9672aa3a0bd3bef8c1dd.patch
https://metacpan.org/release/SHAY/perl-5.38.4/changes
https://metacpan.org/release/SHAY/perl-5.40.2/changes

Timeline