Long-standing vulnerability in ‘needrestart’ affects Ubuntu Linux and exposes systems to root access

Recently, a series of vulnerabilities have been brought to light in the needrestartutility, widely used on Ubuntu Linux. These flaws, present for over a decade, allow an attacker with local access to gain rootprivileges. This situation raises crucial questions about the security of our systems. Let’s explore these alarming findings in more detail and the measures to be taken.

The vulnerabilities identified

An overview of the flaws

Five major vulnerabilities, referenced by their CVE codes, have been detected in needrestart. These flaws provide privilege escalation opportunities for anyone with local access to the computer. Let’s briefly analyze the vulnerabilities:

  • CVE-2024-48990: exploitation of the PYTHONPATHenvironment variable.
  • CVE-2024-48992: vulnerability of the Ruby module by contamination of RUBYLIB.
  • CVE-2024-48991: Race condition allowing replacement of the Python executable.
  • CVE-2024-10224: Manipulation of filenames by an attacker.
  • CVE-2024-11003: Insecure use of the eval()function.

The implications of these flaws

These vulnerabilities present dangerous opportunities for attackers. Here are the potential effects if they were exploited:

  • Privilege escalation to root without additional authentication.
  • Unauthorized access to sensitive system files.
  • Arbitrary code execution under an administrative session.

Why is it crucial to act quickly?

Why is it crucial to act quickly?

With the increasing popularity of needrestart in many Linux distributions, the presence of such vulnerabilities, especially these old ones, represents a high security risk. Several past attacks have demonstrated that the Linux vulnerabilities can be exploited successfully. Failure to fix these flaws could lead to serious consequences for businesses and users.

A summary table of vulnerabilities

🔍 Vulnerability 🌐CVE code
Exploiting PYTHONPATH CVE-2024-48990
RUBYLIB injection CVE-2024-48992
Replacing the Python executable CVE-2024-48991
Manipulating file names CVE-2024-10224
Unsafe use of eval() CVE-2024-11003

Safety measures to adopt

Recommended update

The main recommendation is to update your installation of needrestart to a version later than 3.8. This will eliminate any identified vulnerabilities. Additionally, additional configurations via the file needrestart.conf could strengthen the security of your system:


# Disable interpreter parsers.
$nrconf{interpscan} = 0;

Final Thoughts

The security of our Linux systems relies on our ability to quickly identify and fix vulnerabilities. What do you think about the impact of such flaws on your own use of Ubuntu? Share your opinion in comments!