CVE-2026-0861: Integer overflow in memalign leads to heap corruption
Integer overflow in memalign leads to heap corruption
Other sources
Passing too large an alignment to the memalign suite of functions (memalign, posixmemalign, alignedalloc, valloc, pvalloc) in the GNU C Library version 2.30 to 2.42 may result in an integer overflow, which could consequently result in a heap corruption.
— Red Hat
Passing too large an alignment to the memalign suite of functions (memalign, posixmemalign, alignedalloc) in the GNU C Library version 2.30 to 2.42 may result in an integer overflow, which could consequently result in a heap corruption.
Note that the attacker must have control over both, the size as well as the alignment arguments of the memalign function to be able to exploit this. The size parameter must be close enough to PTRDIFFMAX so as to overflow sizet along with the large alignment argument. This limits the malicious inputs for the alignment for memalign to the range [1<<62+ 1, 1<<63] and exactly 1<<63 for posixmemalign and alignedalloc.
Typically the alignment argument passed to such functions is a known constrained quantity (e.g. page size, block size, struct sizes) and is not attacker controlled, because of which this may not be easily exploitable in practice. An application bug could potentially result in the input alignment being too large, e.g. due to a different buffer overflow or integer overflow in the application or its dependent libraries, but that is again an uncommon usage pattern given typical sources of alignments.
— NVD
Passing too large an alignment to the memalign suite of functions (memalign, posixmemalign, alignedalloc) in the GNU C Library version 2.30 to 2.42 may result in an integer overflow, which could consequently result in a heap corruption.
Note that the attacker must have control over both, the size as well as the alignment arguments of the memalign function to be able to exploit this. The size parameter must be close enough to PTRDIFFMAX so as to overflow sizet along with the large alignment argument. This limits the malicious inputs for the alignment for memalign to the range [162+ 1, 163] and exactly 163 for posixmemalign and alignedalloc.
Typically the alignment argument passed to such functions is a known constrained quantity (e.g. page size, block size, struct sizes) and is not attacker controlled, because of which this may not be easily exploitable in practice. An application bug could potentially result in the input alignment being too large, e.g. due to a different buffer overflow or integer overflow in the application or its dependent libraries, but that is again an uncommon usage pattern given typical sources of alignments.
— IBM
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2026-0861?
CVE-2026-0861 is considered a high severity vulnerability due to the potential for heap corruption.
How do I fix CVE-2026-0861?
To fix CVE-2026-0861, update the GNU C Library to a version beyond 2.42.
What causes CVE-2026-0861?
CVE-2026-0861 is caused by an integer overflow from passing overly large alignment values to the memalign functions.
What systems are affected by CVE-2026-0861?
CVE-2026-0861 affects the GNU C Library versions 2.30 through 2.42.
What are the potential impacts of CVE-2026-0861?
The potential impacts of CVE-2026-0861 include heap corruption, which may lead to application crashes or arbitrary code execution.