CVE-2026-59142 Memory corruption in Data::HashMap::Shared
A local attacker can trigger an out-of-bounds read in the Perl Data::HashMap::Shared library by manipulating the backing file, causing crashes or memory disclosure.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2026-59142?
CVE-2026-59142 is a critical memory corruption vulnerability in EGOR Data::HashMap::Shared, published on 21 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
Data::HashMap::Shared versions before 0.14 for Perl allow an out-of-bounds read via an unvalidated arena offset and length in shm_str_copy.
The attach-time validator shm_validate_header checks the header scalars and region layout against the file size, but does not validate the array contents it then trusts. shm_str_copy does memcpy(dst, arena + off, len) with off and len read raw from the mmap'd segment and unbounded, on the each, keys, values, pop, shift, take, swap, drain and cursor paths. The get path bounds off and len separately and is not affected.
A local peer that can write the backing file can leave the header valid while poisoning a record's offset and length, so iterating or draining the map copies a file-controlled offset and length out of the arena, reading adjacent memory or crashing the process.
Weakness: CWE-125
Which versions are affected by CVE-2026-59142?
How do I fix CVE-2026-59142?
No fix has been published for CVE-2026-59142 yet. Limit exposure of the affected software until one is available.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2026-59142 being exploited?
There is no known exploitation of CVE-2026-59142 in the wild and no public exploit code.
Sources
Also known as GHSA-4m33-8fcc-g5rp.