ZeroHour
Security Affairspublished ()ingested @securityaffairs

Decade-old local privilege escalation bugs impacts Ubuntu needrestart package

Vulnerabilities mentionedAll →

CVEVulnerabilityCVSSEPSSFlagsAffectedExposurePublished
CVE-2024-10224
Qualys discovered that if unsanitized input was used with the library Modules::ScanDeps, before version 1.36 a local attacker could possibly execute arbitrary s

Qualys discovered that if unsanitized input was used with the library Modules::ScanDeps, before version 1.36 a local attacker could possibly execute arbitrary shell commands by open()ing a "pesky pipe" (such as passing "commands|" as a filename) or by passing arbitrary strings to eval().

NVD description · AI analysis pending
7.89% PoC ×3
  • rschupp modules\
  • rschupp debian linux
CVE-2024-48990
+3 in the same advisory: …11003 …48992 …48991
Local Privilege Escalation in Ubuntu needrestart via attacker-controlled PYTHONPATH

CVE-2024-48990 is an uncontrolled search path flaw (CWE-427) in needrestart, the tool used on Ubuntu and Debian systems to check which services need restarting, affecting all versions before 3.8. A local attacker with low privileges can set the PYTHONPATH environment variable so that when needrestart executes the Python interpreter with root privileges, the attacker's code is loaded and run as root. Successful exploitation yields arbitrary code execution as root, giving the attacker full control of the affected machine. Any server, workstation, or container image running needrestart prior to 3.8 — most notably Ubuntu systems, where the package is shipped and maintained — is affected. No public proof-of-concept, CISA KEV listing, or confirmed in-the-wild exploitation is known yet, though EPSS assigns an elevated 20.5% probability of exploitation within 30 days (97th percentile).

Do: Upgrade needrestart to version 3.8 or later using your distribution's security updates (Ubuntu packages are issued by the Ubuntu security team). Administrators should audit installed systems (e.g., check the needrestart package version) and, as an interim mitigation, restrict local unprivileged access and be cautious running needrestart in environments where users can control environment variables. Given the elevated EPSS score, prioritize patching multi-user servers where local accounts or untrusted code can run.

7.820%
  • needrestart project (packaged in Ubuntu) needrestart all versions before 3.8
masswell over 1,000,000 installations; plausibly tens of millions of systems
Full article442 words · extracted from securityaffairs.com · click to collapse

Pierluigi Paganini November 21, 2024

Decade-old flaws in the needrestart package in Ubuntu Server could allow local attackers to gain root privileges without user interaction.

The Qualys Threat Research Unit (TRU) discovered five Local Privilege Escalation (LPE) decade-old security vulnerabilities in the needrestart package that could allow a local attacker to gain root privileges without requiring user interaction.

The needrestart package in Ubuntu is a utility designed to ensure system stability after software updates. When packages are updated, especially ones affecting shared libraries or services, it’s often necessary to restart those services or even the entire system for changes to take effect.

The needrestart package is installed by default in Ubuntu Server, starting with version 21.04. The flaws were likely introduced with the interpreter support in needrestart version 0.8, released in April 2014.

The vulnerabilities have been tracked as CVE-2024-48990, CVE-2024-48991, CVE-2024-48992, CVE-2024-10224, and CVE-2024-11003.

These are the descriptions for the flaws:

  • CVE-2024-48990 (CVSS score: 7.8) – A vulnerability that allows local attackers to execute arbitrary code as root by tricking needrestart into running the Python interpreter with an attacker-controlled PYTHONPATH environment variable.
  • CVE-2024-48991 (CVSS score: 7.8) – A vulnerability that allows local attackers to execute arbitrary code as root by winning a race condition and tricking needrestart into running their own, fake Python interpreter (instead of the system’s real Python interpreter).
  • CVE-2024-48992 (CVSS score: 7.8) – A vulnerability that allows local attackers to execute arbitrary code as root by tricking needrestart into running the Ruby interpreter with an attacker-controlled RUBYLIB environment variable.
  • CVE-2024-11003 (CVSS score: 7.8) and CVE-2024-10224 (CVSS score: 5.3) – These vulnerabilities allows a local attacker to execute arbitrary shell commands.

The Qualys TRU team has developed functional exploits for disclosed vulnerabilities, warning that they are easily exploitable and may soon see public working exploits.

“These vulnerabilities in the needrestart utility allow local users to escalate their privileges by executing arbitrary code during package installations or upgrades, where needrestart is often run as the root user.” reads the advisory. “An attacker exploiting these vulnerabilities could gain root access, compromising system integrity and security.”

Successful exploitation of these flaws could expose enterprises to severe risks like unauthorized data access, malware, and operational disruptions, leading to breaches, non-compliance, and reputational harm. Immediate mitigation through software updates or disabling the vulnerability is essential.

To prevent the exploitation of the flaw Qualys researchers recommend disabling the interpreter scanning feature in needrestart by modifying its configuration file, typically located at /etc/needrestart/needrestart.conf. Add the line $nrconf{interpscan} = 0; to disable interpreter scanners and block the vulnerability.

Follow me on Twitter: @securityaffairs and Facebook and Mastodon

Pierluigi Paganini

(SecurityAffairs – hacking, Ubuntu)



Text extracted automatically; images, tables and formatting may be missing. Original: https://securityaffairs.com/171228/security/privilege-escalation-bugs-ubuntu-needrestart-package.html