Perl is vulnerable to a heap buffer overflow when transliterating non-ASCII bytes
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Partial Red Hat: 1 fixed, 2 without a fix
Attack profile from CVSS 3.1 · CISA ADP. Fix status from CNA and Red Hat. Impact type from CWE-122 and the CVSS impact.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Perl | perl | 5.41.0 – 5.41.10; 5.39.0 to before 5.40.2-RC1; 5.33.1 to before 5.38.4-RC1 | 5.40.2-RC1, 5.38.4-RC1 | Patch available | CNA |
- perl VendorPerl Affected 5.41.0 – 5.41.10; 5.39.0 to before 5.40.2-RC1; 5.33.1 to before 5.38.4-RC1 Fixed in 5.40.2-RC1, 5.38.4-RC1 Patch available CNA
Remediation
- Fix · CNA perl (perl) Fixed in 5.40.2-RC1, 5.38.4-RC1
Red Hat 1 advisory
- RHSA-2025:7500 Released 2025-05-13 · Red Hat rating Importantperl security update
- Red Hat Enterprise Linux AppStream (v. 10) perl-4:5.40.2-512.1.el10_0, perl-Attribute-Handlers-1.03-512.1.el10_0, perl-AutoLoader-5.74-512.1.el10_0 +47
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux AppStream (v. 10) | Fixed | RHSA-2025:7500 |
Not affected: 3 products
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- Red Hat OpenShift Container Platform 4
Timeline
- 2026-10-02 Threatist record created from CVE-2024-56406
- 2026-10-03 Alias added: GHSA-p6jf-pv8c-623c
References
More Perl vulnerabilities
- TI-2022-24100 In Perl 5.34.0, function S_find_uninit_var in sv.c has a stack-based crash that can lead… CVSS 3.1CRITICAL 9.8
- TI-2012-05140 The _compile function in Maketext.pm in the Locale::Maketext implementation in Perl… CVSS 2.0HIGH 7.5
- TI-2018-12932 Perl before 5.26.3 and 5.28.0 before 5.28.1 has a buffer overflow via a crafted regular… CVSS 3.0CRITICAL 9.8
- TI-2018-12931 Perl before 5.26.3 and 5.28.x before 5.28.1 has a buffer overflow via a crafted regular… CVSS 3.0CRITICAL 9.8
- TI-2018-05049 Heap-based buffer overflow in the pack function in Perl before 5.26.2 allows… CVSS 3.0CRITICAL 9.8
- TI-2017-09493 Stack-based buffer overflow in the CPerlHost::Add method in win32/perlhost.h in Perl… CVSS 3.0CRITICAL 9.8
Sources
- CVE-2024-56406 · CVE Program
- CVE-2024-56406 · NVD
- FIRST EPSS
- GHSA-p6jf-pv8c-623c · GitHub Advisory Database · CC BY 4.0
- CVE-2024-56406 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences