Executive brief
A vulnerability exists in the GNU C Library (glibc), a fundamental component of Linux systems used by almost all applications for basic tasks like logging. By manipulating how a program starts, a local attacker can cause a memory error that allows them to crash applications or gain full administrative (root) privileges on the system. This poses a significant risk to multi-user environments and servers where unprivileged users might attempt to escalate their access.
Technical details
A heap-based buffer overflow exists in the __vsyslog_internal function within glibc, which is internally called by syslog() and vsyslog(). The vulnerability is triggered when openlog() is not called (or called with a NULL ident) and the program name (argv[0]) exceeds 1024 bytes. In this state, the function fails to correctly calculate the required buffer size, resulting in a 1-byte malloc() that is subsequently overflowed by the attacker-controlled program name and message content. This can be exploited via SUID-root binaries like 'su' that use PAM (which calls syslog on authentication failure) to achieve local privilege escalation to root. The issue affects glibc versions 2.36 and newer.
Affected products
- GNU glibc 2.36 and newer
Timeline
- 2022-08-01: other: Vulnerability introduced in glibc 2.37 and backported to 2.36
- 2024-01-30: disclosed: Advisory published by Qualys
- 2024-01-31: advisory: CVE-2023-6246 assigned and NVD entry created
References
- http://packetstormsecurity.com/files/176931/glibc-qsort-Out-Of-Bounds-Read-Write.html
- http://packetstormsecurity.com/files/176932/glibc-syslog-Heap-Based-Buffer-Overflow.html
- http://seclists.org/fulldisclosure/2024/Feb/3
- http://seclists.org/fulldisclosure/2024/Feb/5
- https://access.redhat.com/security/cve/CVE-2023-6246
- https://bugzilla.redhat.com/show_bug.cgi?id=2249053
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/D2FIH77VHY3KCRROCXOT6L27WMZXSJ2G/