Glibc glob can double-free when memory runs out
CVE-2026-126765 hits glibc 2.44 and earlier only when an allocation fails after glob has already rewritten some matched names.
The GNU C Library has published an advisory for a double-free in its filename-matching code, tracked as CVE-2026-126765. In glibc 2.44 and earlier, the glob routines can free the same heap block twice if a memory allocation fails while they are prefixing matched names with a directory path. Names already rewritten are released, but their pointers remain in the result list, and the error path frees them again.
The bug is hard to reach. The failing allocation has to come after at least one name has been rewritten, which means the process is already near its memory limit, for example under an address-space cap or on a 32-bit system. An attacker would also need a way to make the match set large enough to exhaust memory, such as control of the glob pattern plus knowledge of the filesystem layout. Every architecture and ABI that glibc supports is affected. The issue was reported by Jack Doan. Its CVSS score is 3.7, reflecting a low availability impact and no confidentiality or integrity loss.