CVE-2024-56406 Perl is vulnerable to a heap buffer overflow when transliterating non-ASCII bytes
Attackers can trigger a heap buffer overflow in Perl's transliteration operator, causing crashes or potentially executing arbitrary code.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-56406?
CVE-2024-56406 is a high-severity memory corruption vulnerability in perl, published on 13 Apr 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official 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.
Which versions are affected by CVE-2024-56406?
It affects 1 product.
Linux distribution packages (40)
perl AlmaLinux:10 | All versions | 4:5.40.2-512.1.el10_0 |
perl-Attribute-Handlers AlmaLinux:10 | All versions | 1.03-512.1.el10_0 |
perl-AutoLoader AlmaLinux:10 | All versions | 5.74-512.1.el10_0 |
perl-AutoSplit AlmaLinux:10 | All versions | 5.74-512.1.el10_0 |
perl-B AlmaLinux:10 | All versions | 1.89-512.1.el10_0 |
perl-Benchmark AlmaLinux:10 | All versions | 1.25-512.1.el10_0 |
perl-Class-Struct AlmaLinux:10 | All versions | 0.68-512.1.el10_0 |
perl-Config-Extensions AlmaLinux:10 | All versions | 0.03-512.1.el10_0 |
perl-DBM_Filter AlmaLinux:10 | All versions | 0.06-512.1.el10_0 |
perl-Devel-Peek AlmaLinux:10 | All versions | 1.34-512.1.el10_0 |
perl-Devel-SelfStubber AlmaLinux:10 | All versions | 1.06-512.1.el10_0 |
perl-DirHandle AlmaLinux:10 | All versions | 1.05-512.1.el10_0 |
perl-Dumpvalue AlmaLinux:10 | All versions | 2.27-512.1.el10_0 |
perl-DynaLoader AlmaLinux:10 | All versions | 1.56-512.1.el10_0 |
perl-English AlmaLinux:10 | All versions | 1.11-512.1.el10_0 |
perl-Errno AlmaLinux:10 | All versions | 1.38-512.1.el10_0 |
perl-ExtUtils-Constant AlmaLinux:10 | All versions | 0.25-512.1.el10_0 |
perl-ExtUtils-Embed AlmaLinux:10 | All versions | 1.35-512.1.el10_0 |
perl-ExtUtils-Miniperl AlmaLinux:10 | All versions | 1.14-512.1.el10_0 |
perl-Fcntl AlmaLinux:10 | All versions | 1.18-512.1.el10_0 |
perl-File-Basename AlmaLinux:10 | All versions | 2.86-512.1.el10_0 |
perl-File-Compare AlmaLinux:10 | All versions | 1.100.800-512.1.el10_0 |
perl-File-Copy AlmaLinux:10 | All versions | 2.41-512.1.el10_0 |
perl-File-DosGlob AlmaLinux:10 | All versions | 1.12-512.1.el10_0 |
perl-File-Find AlmaLinux:10 | All versions | 1.44-512.1.el10_0 |
perl-File-stat AlmaLinux:10 | All versions | 1.14-512.1.el10_0 |
perl-FileCache AlmaLinux:10 | All versions | 1.10-512.1.el10_0 |
perl-FileHandle AlmaLinux:10 | All versions | 2.05-512.1.el10_0 |
perl-FindBin AlmaLinux:10 | All versions | 1.54-512.1.el10_0 |
perl-GDBM_File AlmaLinux:10 | All versions | 1:1.24-512.1.el10_0 |
perl-Getopt-Std AlmaLinux:10 | All versions | 1.14-512.1.el10_0 |
perl-Hash-Util AlmaLinux:10 | All versions | 0.32-512.1.el10_0 |
perl-Hash-Util-FieldHash AlmaLinux:10 | All versions | 1.27-512.1.el10_0 |
perl-I18N-Collate AlmaLinux:10 | All versions | 1.02-512.1.el10_0 |
perl-I18N-LangTags AlmaLinux:10 | All versions | 0.45-512.1.el10_0 |
perl-I18N-Langinfo AlmaLinux:10 | All versions | 0.24-512.1.el10_0 |
perl-IO AlmaLinux:10 | All versions | 1.55-512.1.el10_0 |
perl-IPC-Open3 AlmaLinux:10 | All versions | 1.22-512.1.el10_0 |
perl-Locale-Maketext-Simple AlmaLinux:10 | All versions | 1:0.21-512.1.el10_0 |
perl-Math-Complex AlmaLinux:10 | All versions | 1.62-512.1.el10_0 |
Products include Perl Perl.
How do I fix CVE-2024-56406?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2024-56406 being exploited?
There is no known exploitation of CVE-2024-56406 in the wild and no public exploit code.
Other vulnerabilities in perl
Sources
Also known as ALPINE-CVE-2024-56406, ALSA-2025:7500, AZL-60384, AZL-60409, BELL-CVE-2024-56406, DEBIAN-CVE-2024-56406 and 16 more.