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

Published Apr 13, 2025
·
Updated

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, Sdotransinvmap 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.

Other sources

A heap buffer overflow vulnerability was discovered in Perl.

When there are non-ASCII bytes in the left-hand-side of the tr operator, Sdotransinvmap 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.

Red Hat

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

Microsoft

Affected Software

8 affected componentsFixes available
debian/perl<=5.36.0-7+deb12u1
5.32.1-4+deb11u35.32.1-4+deb11u45.36.0-7+deb12u25.40.1-3
Perl Perl=5.34, =5.36, =5.38, =5.40, >=5.33.1<5.41.10
Perl Perl>=5.33.1<5.38.4
Perl Perl>=5.39.0<5.40.2
Perl Perl>=5.41.0<=5.41.10
Microsoft azl3 perl 5.38.2-508
Microsoft azl3 perl 5.38.2-507
Microsoft cbl2 perl 5.34.1-490

Remediation

Information

Users should update perl to 5.40.2 or 5.38.4, or apply the upstream patch provided in the References section.

Event History

Apr 13, 2025
CVE Published
via MITRE·01:16 PM
Data Sourced
via MITRE·01:16 PM
RemedyDescriptionWeakness
Data Sourced
via Red Hat·02:01 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·02:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Apr 19, 2025
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
SeverityAffected Software
Updated
via Microsoft·07:00 AM
Affected Software
Updated
via Microsoft·07:00 AM
DescriptionSeverity
Apr 30, 2025
Data Sourced
via Ubuntu·03:47 PM
RemedyDescriptionSeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-56406?

CVE-2024-56406 has a high severity due to its potential to cause a heap buffer overflow in Perl.

2

How do I fix CVE-2024-56406?

To fix CVE-2024-56406, upgrade to Perl version 5.40 or later, or apply the provided patches.

3

What versions of Perl are affected by CVE-2024-56406?

CVE-2024-56406 affects Perl versions from 5.34 up to and including 5.40.

4

What kind of vulnerability is CVE-2024-56406?

CVE-2024-56406 is a heap buffer overflow vulnerability that can lead to segmentation faults.

5

What operation in Perl triggers CVE-2024-56406?

The `tr` operator with non-ASCII bytes on the left-hand side triggers CVE-2024-56406.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203