{"id":"CVE-2024-56406","state":"PUBLISHED","title":"Perl is vulnerable to a heap buffer overflow when transliterating non-ASCII bytes","description":"A heap buffer overflow vulnerability was discovered in Perl. \n\nRelease branches 5.34, 5.36, 5.38 and 5.40 are affected, including development versions from 5.33.1 through 5.41.10.\n\nWhen there are non-ASCII bytes in the left-hand-side of the `tr` operator, `S_do_trans_invmap` can overflow the destination pointer `d`.\n\n   $ perl -e '$_ = \"\\x{FF}\" x 1000000; tr/\\xFF/\\x{100}/;' \n   Segmentation fault (core dumped)\n\nIt is believed that this vulnerability can enable Denial of Service and possibly Code Execution attacks on platforms that lack sufficient defenses.","publishedAt":"2025-04-13T13:16:09.841Z","updatedAt":"2025-10-16T14:04:20.393Z","severity":{"score":8.4,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"CISA-ADP"},"assigner":"CPANSec","products":["perl perl"],"affected":[{"vendor":"perl","product":"perl","packageName":"perl","defaultStatus":"unaffected","versions":[{"version":"5.41.0","status":"affected","lessThanOrEqual":"5.41.10","versionType":"custom"},{"version":"5.39.0","status":"affected","lessThan":"5.40.2-RC1","versionType":"custom"},{"version":"5.33.1","status":"affected","lessThan":"5.38.4-RC1","versionType":"custom"}],"collectionURL":"https://cpan.org/modules","programFiles":["op.c"],"programRoutines":[{"name":"S_pmtrans"},{"name":"tr"}],"repo":"https://github.com/Perl/perl5/"}],"references":["https://github.com/Perl/perl5/commit/87f42aa0e0096e9a346c9672aa3a0bd3bef8c1dd.patch","https://metacpan.org/release/SHAY/perl-5.38.4/changes","https://metacpan.org/release/SHAY/perl-5.40.2/changes","http://www.openwall.com/lists/oss-security/2025/04/13/3","http://www.openwall.com/lists/oss-security/2025/04/13/4","http://www.openwall.com/lists/oss-security/2025/04/13/5"],"weaknesses":["CWE-122","CWE-787"],"ingestedAt":"2026-10-29T20:08:12.933Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/56xxx/CVE-2024-56406.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.1","cveMetadata":{"cveId":"CVE-2024-56406","state":"PUBLISHED","datePublished":"2025-04-13T13:16:09.841Z","dateUpdated":"2025-10-16T14:04:20.393Z","assignerShortName":"CPANSec","assignerOrgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","dateReserved":"2024-12-23T02:07:38.152Z"},"containers":{"cna":{"title":"Perl is vulnerable to a heap buffer overflow when transliterating non-ASCII bytes","descriptions":[{"lang":"en","value":"A heap buffer overflow vulnerability was discovered in Perl. \n\nRelease branches 5.34, 5.36, 5.38 and 5.40 are affected, including development versions from 5.33.1 through 5.41.10.\n\nWhen there are non-ASCII bytes in the left-hand-side of the `tr` operator, `S_do_trans_invmap` can overflow the destination pointer `d`.\n\n   $ perl -e '$_ = \"\\x{FF}\" x 1000000; tr/\\xFF/\\x{100}/;' \n   Segmentation fault (core dumped)\n\nIt is believed that this vulnerability can enable Denial of Service and possibly Code Execution attacks on platforms that lack sufficient defenses."}],"affected":[{"vendor":"perl","product":"perl","packageName":"perl","defaultStatus":"unaffected","versions":[{"version":"5.41.0","status":"affected","lessThanOrEqual":"5.41.10","versionType":"custom"},{"version":"5.39.0","status":"affected","lessThan":"5.40.2-RC1","versionType":"custom"},{"version":"5.33.1","status":"affected","lessThan":"5.38.4-RC1","versionType":"custom"}],"collectionURL":"https://cpan.org/modules","programFiles":["op.c"],"programRoutines":[{"name":"S_pmtrans"},{"name":"tr"}],"repo":"https://github.com/Perl/perl5/"}],"references":[{"url":"https://github.com/Perl/perl5/commit/87f42aa0e0096e9a346c9672aa3a0bd3bef8c1dd.patch","tags":["patch"]},{"url":"https://metacpan.org/release/SHAY/perl-5.38.4/changes","tags":["release-notes"]},{"url":"https://metacpan.org/release/SHAY/perl-5.40.2/changes","tags":["release-notes"]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-122","description":"CWE-122 Heap-based Buffer Overflow","lang":"en","type":"CWE"}]},{"descriptions":[{"cweId":"CWE-787","description":"CWE-787 Out-of-bounds Write","lang":"en","type":"CWE"}]}],"providerMetadata":{"shortName":"CPANSec","orgId":"9b29abf9-4ab0-4765-b253-1875cd9b441e","dateUpdated":"2025-04-13T19:29:56.569Z"},"credits":[{"lang":"en","type":"finder","value":"Nathan Mills"}],"solutions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"Users should update perl to 5.40.2 or 5.38.4, or apply the upstream patch provided in the References section.<br><br>"}],"value":"Users should update perl to 5.40.2 or 5.38.4, or apply the upstream patch provided in the References section."}],"source":{"discovery":"UNKNOWN"},"x_generator":{"engine":"Vulnogram 0.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"http://www.openwall.com/lists/oss-security/2025/04/13/3"},{"url":"http://www.openwall.com/lists/oss-security/2025/04/13/4"},{"url":"http://www.openwall.com/lists/oss-security/2025/04/13/5"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-04-13T22:02:35.643Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":8.4,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"NONE","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"timestamp":"2025-10-16T14:04:16.993103Z","id":"CVE-2024-56406","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-10-16T14:04:20.393Z"}}]}}}