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

High 8.4 Published Updated

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.

Weakness: CWE-787, CWE-122

Which versions are affected by CVE-2024-56406?

It affects 1 product.

Linux distribution packages (40)
perl AlmaLinux:10All versions4:5.40.2-512.1.el10_0
perl-Attribute-Handlers AlmaLinux:10All versions1.03-512.1.el10_0
perl-AutoLoader AlmaLinux:10All versions5.74-512.1.el10_0
perl-AutoSplit AlmaLinux:10All versions5.74-512.1.el10_0
perl-B AlmaLinux:10All versions1.89-512.1.el10_0
perl-Benchmark AlmaLinux:10All versions1.25-512.1.el10_0
perl-Class-Struct AlmaLinux:10All versions0.68-512.1.el10_0
perl-Config-Extensions AlmaLinux:10All versions0.03-512.1.el10_0
perl-DBM_Filter AlmaLinux:10All versions0.06-512.1.el10_0
perl-Devel-Peek AlmaLinux:10All versions1.34-512.1.el10_0
perl-Devel-SelfStubber AlmaLinux:10All versions1.06-512.1.el10_0
perl-DirHandle AlmaLinux:10All versions1.05-512.1.el10_0
perl-Dumpvalue AlmaLinux:10All versions2.27-512.1.el10_0
perl-DynaLoader AlmaLinux:10All versions1.56-512.1.el10_0
perl-English AlmaLinux:10All versions1.11-512.1.el10_0
perl-Errno AlmaLinux:10All versions1.38-512.1.el10_0
perl-ExtUtils-Constant AlmaLinux:10All versions0.25-512.1.el10_0
perl-ExtUtils-Embed AlmaLinux:10All versions1.35-512.1.el10_0
perl-ExtUtils-Miniperl AlmaLinux:10All versions1.14-512.1.el10_0
perl-Fcntl AlmaLinux:10All versions1.18-512.1.el10_0
perl-File-Basename AlmaLinux:10All versions2.86-512.1.el10_0
perl-File-Compare AlmaLinux:10All versions1.100.800-512.1.el10_0
perl-File-Copy AlmaLinux:10All versions2.41-512.1.el10_0
perl-File-DosGlob AlmaLinux:10All versions1.12-512.1.el10_0
perl-File-Find AlmaLinux:10All versions1.44-512.1.el10_0
perl-File-stat AlmaLinux:10All versions1.14-512.1.el10_0
perl-FileCache AlmaLinux:10All versions1.10-512.1.el10_0
perl-FileHandle AlmaLinux:10All versions2.05-512.1.el10_0
perl-FindBin AlmaLinux:10All versions1.54-512.1.el10_0
perl-GDBM_File AlmaLinux:10All versions1:1.24-512.1.el10_0
perl-Getopt-Std AlmaLinux:10All versions1.14-512.1.el10_0
perl-Hash-Util AlmaLinux:10All versions0.32-512.1.el10_0
perl-Hash-Util-FieldHash AlmaLinux:10All versions1.27-512.1.el10_0
perl-I18N-Collate AlmaLinux:10All versions1.02-512.1.el10_0
perl-I18N-LangTags AlmaLinux:10All versions0.45-512.1.el10_0
perl-I18N-Langinfo AlmaLinux:10All versions0.24-512.1.el10_0
perl-IO AlmaLinux:10All versions1.55-512.1.el10_0
perl-IPC-Open3 AlmaLinux:10All versions1.22-512.1.el10_0
perl-Locale-Maketext-Simple AlmaLinux:10All versions1:0.21-512.1.el10_0
perl-Math-Complex AlmaLinux:10All versions1.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.

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.

Is CVE-2024-56406 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free