# CVE-2024-56406: Perl is vulnerable to a heap buffer overflow when transliterating non-ASCII bytes

- Severity: High 8.4 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.54%, higher than 46% of CVEs (2026-12-01)
- Published: 2025-04-13T13:16:09.841Z
- Modified: 2026-06-17T08:12:08.977Z
- Weaknesses: CWE-122, CWE-787
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: CPANSec

## Description

A heap buffer overflow vulnerability was discovered in Perl. 

Release branches 5.34, 5.36, 5.38 and 5.40 are affected, including development versions from 5.33.1 through 5.41.10.

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.

(As written by CVE List.)

## Affected

- perl: from 5.41.0 up to 5.41.10; from 5.39.0 before 5.40.2-RC1; from 5.33.1 before 5.38.4-RC1
- perl perl: from 5.33.1 before 5.38.4; from 5.39.0 before 5.40.2; from 5.41.0 up to 5.41.10

## References

- <https://github.com/Perl/perl5/commit/87f42aa0e0096e9a346c9672aa3a0bd3bef8c1dd.patch> (patch)
- <https://metacpan.org/release/SHAY/perl-5.38.4/changes> (release-notes)
- <https://metacpan.org/release/SHAY/perl-5.40.2/changes> (release-notes)
- <http://www.openwall.com/lists/oss-security/2025/04/13/3> (mailing-list)
- <http://www.openwall.com/lists/oss-security/2025/04/13/4> (mailing-list)
- <http://www.openwall.com/lists/oss-security/2025/04/13/5> (mailing-list)

## Sources

- CVE List: [CVE-2024-56406](https://www.cve.org/CVERecord?id=CVE-2024-56406), CVE Terms of Use, modified 2025-10-16
- NVD: [CVE-2024-56406](https://nvd.nist.gov/vuln/detail/CVE-2024-56406), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-56406 · Whole record: https://cve.day/CVE-2024-56406.json · Rebuilt by cve.day 2026-11-25T22:58:52.528Z
