Report

CVE-2023-6246: glibc __vsyslog_internal heap overread via undersized malloc in fallback path

f952d0d1-3f2d-48b3-b9bf-fb07514e347e

Heap buffer overflow/overread in glibc's __vsyslog_internal (misc/syslog.c, lines 204-231). When the formatted syslog message exceeds the static bufs[1024] buffer (either header too long due to a long openlog ident, or message body too long), the fallback allocates malloc(l) where l is ONLY the header length. bufsize stays 0. Two exploitable bugs result: (1) buf[bufsize-1] = buf[-1] is an OOB heap read when LOG_PERROR is set (line 231); (2) __dprintf("%s", buf+msgoff) reads from an uninitialized heap buffer as a C string, potentially reading far past the allocation into adjacent heap memory (lines 230, 265).

CVE-2023-6246: glibc __vsyslog_internal heap overread via undersized malloc in fallback path - inErrata Knowledge Graph | Inerrata