The Qualys Threat Research Unit (TRU) recently disclosed a high-severity vulnerability in GNU C Library aka glibc that could allow a local attacker to gain root privileges. This vulnerability, tracked as CVE-2023-4911 and nicknamed “Looney Tunables”, has been given a CVSS score of 7.8 making it a critical security issue that needs immediate attention.
In this blog post, we will take a look into this vulnerability – its origins, impact, and the steps you need to take to patch this vulnerability on Linux systems using glibc.
The GNU C Library or glibc provides core OS functionality like memory allocation, input/output operations, and thread handling required by most programs on a Linux system.
A key component of glibc is the dynamic loader (ld.so) which loads the required shared libraries and prepares the program for execution. When a program starts, the loader examines it to determine the shared libraries needed and loads them into memory. It then resolves symbol references like function/variable names and links the libraries to the executable.
The loader runs with elevated privileges when executing setuid or setgid programs, making it security-sensitive. The GLIBC_TUNABLES environment variable was introduced in glibc 2.34 to allow tweaking library behavior at runtime without recompiling the app or library.
It allows parameters like memory allocation, locking, and threading to be tuned by setting colon separated key-value pairs in GLIBC_TUNABLES. For example:
GLIBC_TUNABLES=glibc.malloc.mmap_max:33554432
This provides granular control over glibc functionality. The loader parses GLIBC_TUNABLES during initialization and applies the tunable settings to alter behavior.
While a useful functionality for developers and sysadmins, the improper handling of GLIBC_TUNABLES also introduced the vulnerability leading to CVE-2023-4911. The parser had a flaw that caused a buffer overflow when manipulating the tunable strings.
CVE ID: CVE-2023-4911
Description: Buffer overflow in GNU C Library’s dynamic loader ld.so while processing the GLIBC_TUNABLES environment variable
CVSS Score: 7.8 HIGH
Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
The vulnerability stems from a flaw in how glibc’s dynamic loader parses the GLIBC_TUNABLES environment variable. Improper handling of colon-separated key-value pairs can trigger a buffer overflow due to a logic error while duplicating the tunable string. This could allow a local attacker to execute arbitrary code as root when running binaries with sudo permissions. Successful exploitation leads to privilege escalation to root on the affected system. For more technical details visit the original post.
The Qualys researchers successfully exploited this vulnerability to gain root privileges on default installations of Fedora 37/38, Ubuntu 22.04/23.04, and Debian 12/13. Other glibc based distributions are also likely affected.
Fedora 37 and 38
Ubuntu 22.04 and 23.04
Debian 12 and 13
Other glibc based Linux distributions are also likely vulnerable.
We recommend checking these advisories from the popular Linux distributions.
As per the proof-of-concept released, the attack works by modifying LD_LIBRARY_PATH to load malicious libraries and brute-forcing memory addresses. On average, it takes a few minutes to successfully execute arbitrary code as root depending on the system. The vulnerability impacts any Linux distribution using glibc 2.34 or later.
If you are not sure which glibc version your machine has, run this command to check the glibc version. The same command should work on other Linux distributions. Alternatively, you can use rpm -q glibc on RedHat and CentOS.
The most effective mitigation is to install the glibc updates provided by your Linux distribution containing the fix for CVE-2023-4911. This patches the vulnerable code in glibc’s dynamic loader and prevents the buffer overflow from occurring.
Please ensure to check the Distribution advisories about the patch. Red Hat has published instructions for an alternate mitigation using SystemTap. This involves creating a script that monitors for the GLIBC_TUNABLES environment variable being used and immediately terminates the process.
The Looney Tunables vulnerability is extremely serious given the ubiquity of the GNU C Library on Linux systems. If exploited, it leads to immediate root access on the host. Quickly patching glibc is highly recommended to prevent potential compromise of your systems.
To summarize, CVE-2023-4911 is a high-severity local privilege escalation affecting glibc that allows gaining root privileges on Linux. Updating glibc on your systems is strongly advised to mitigate this vulnerability.
We hope this post helps you know about Looney Tunables ( CVE-2023-4911)- A high-severity Local Privilege Escalation Vulnerability in GNU C Library Aka glibc. Thanks for reading this post. Please share this post and help secure the digital world. Visit our website thesecmaster.com, and our social media page on Facebook, LinkedIn, Twitter, Telegram, Tumblr, Medium, and Instagram and subscribe to receive updates like this.
You may also like these articles:
How to Fix CVE-2022-2959- A Privilege Escalation Vulnerability in Linux Kernel
How To Fix The Dirty Pipe Vulnerability In Linux Kernel- CVE-2022-0847
How To Fix CVE-2021-44731 (Oh Snap!)- A Privilege Escalation Vulnerability In Snap Package Manager
What is a Privilege Escalation Attack? How To Prevent Privilege Escalation Attacks?
Arun KL is a cybersecurity professional with 15+ years of experience in IT infrastructure, cloud security, vulnerability management, Penetration Testing, security operations, and incident response. He is adept at designing and implementing robust security solutions to safeguard systems and data. Arun holds multiple industry certifications including CCNA, CCNA Security, RHCE, CEH, and AWS Security.
“Knowledge Arsenal: Empowering Your Security Journey through Continuous Learning”
"Cybersecurity All-in-One For Dummies" offers a comprehensive guide to securing personal and business digital assets from cyber threats, with actionable insights from industry experts.
BurpGPT is a cutting-edge Burp Suite extension that harnesses the power of OpenAI's language models to revolutionize web application security testing. With customizable prompts and advanced AI capabilities, BurpGPT enables security professionals to uncover bespoke vulnerabilities, streamline assessments, and stay ahead of evolving threats.
PentestGPT, developed by Gelei Deng and team, revolutionizes penetration testing by harnessing AI power. Leveraging OpenAI's GPT-4, it automates and streamlines the process, making it efficient and accessible. With advanced features and interactive guidance, PentestGPT empowers testers to identify vulnerabilities effectively, representing a significant leap in cybersecurity.
Tenable BurpGPT is a powerful Burp Suite extension that leverages OpenAI's advanced language models to analyze HTTP traffic and identify potential security risks. By automating vulnerability detection and providing AI-generated insights, BurpGPT dramatically reduces manual testing efforts for security researchers, developers, and pentesters.
Microsoft Security Copilot is a revolutionary AI-powered security solution that empowers cybersecurity professionals to identify and address potential breaches effectively. By harnessing advanced technologies like OpenAI's GPT-4 and Microsoft's extensive threat intelligence, Security Copilot streamlines threat detection and response, enabling defenders to operate at machine speed and scale.