CVE-2026-0861 PUBLISHED

Integer overflow in memalign leads to heap corruption

Assigner: glibc
Reserved: 12.01.2026 Published: 14.01.2026 Updated: 16.01.2026

Passing too large an alignment to the memalign suite of functions (memalign, posix_memalign, aligned_alloc) 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 PTRDIFF_MAX so as to overflow size_t 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 posix_memalign and aligned_alloc.

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.

Product Status

Vendor The GNU C Library
Product glibc
Versions Default: unaffected
  • affected from 2.30 to 2.42 (incl.)

Credits

  • Igor Morgenstern, Aisle Research finder

References

Problem Types

  • CWE-190 Integer Overflow or Wraparound CWE

Impacts

  • CAPEC-129 Pointer Manipulation