Perl versions before 5.40.5-RC1, from 5.41.0 before 5.42.3-RC1, from 5.43.0 before 5.43.11 have an integer overflow in S_measure_struct leading to an out-of-bounds heap read in pack and unpack.
S_measure_struct adds each item's size times its repeat count to a running total with no overflow check, so a large repeat count in a pack or unpack template wraps the signed SSize_t total negative. The @, X, and x position codes then guard their moves with a signed length comparison that passes when the length is negative, advancing the buffer pointer out of bounds.
A template derived from untrusted input can read heap memory past the buffer and return it to the caller.
{
"cna_assigner": "CPANSec",
"cwe_ids": [
"CWE-125",
"CWE-190"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/57xxx/CVE-2026-57432.json"
}{
"cpe": "cpe:2.3:a:perl:perl:*:*:*:*:*:*:*:*",
"extracted_events": [
{
"introduced": "0"
},
{
"last_affected": "5.43.10"
}
],
"source": [
"CPE_RANGE",
"REFERENCES"
]
}
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2026-57432.json"
[
{
"deprecated": false,
"digest": {
"line_hashes": [
"201862577156805249707604620553032475083",
"81551603836204907529493426019519997190",
"156059514884981184402847233614461914785",
"94570857617259539047657028996045109747",
"97659039899658249284388648446262969742",
"151926469226482392204243810170594964244",
"272884511119481635539903956287963567103",
"222344025253663211649859476963107431631",
"236897441416428657598893805152526053149"
],
"threshold": 0.9
},
"id": "CVE-2026-57432-567f9e91",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/perl/perl5/commit/40754edc72dd3e513d758153c0e2f0215897740e",
"target": {
"file": "pp_pack.c"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "25072063771270511445671413082026489545",
"length": 1564
},
"id": "CVE-2026-57432-7dacdb06",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/perl/perl5/commit/5f7eb6bbbe0510964e3fb1d6bb691e5445913e55",
"target": {
"file": "pp_pack.c",
"function": "S_measure_struct"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"29903863876335406943443366041508711239",
"69081311608836401256429370573162305475",
"82901968090413512737454453188025013684",
"188272959908224046124473974834687995312"
],
"threshold": 0.9
},
"id": "CVE-2026-57432-a8660b53",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/perl/perl5/commit/5f7eb6bbbe0510964e3fb1d6bb691e5445913e55",
"target": {
"file": "pp_pack.c"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "234785783132956280921451274473264633819",
"length": 1714
},
"id": "CVE-2026-57432-b85c915f",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/perl/perl5/commit/40754edc72dd3e513d758153c0e2f0215897740e",
"target": {
"file": "pp_pack.c",
"function": "S_measure_struct"
}
}
]
"2026-09-10T08:21:23Z"