CVE-2024-48990

7.8 HIGH

📋 TL;DR

CVE-2024-48990 is a local privilege escalation vulnerability in needrestart versions before 3.8. Attackers can exploit it by manipulating the PYTHONPATH environment variable to execute arbitrary code with root privileges. This affects Linux systems where needrestart is installed and configured to run with elevated permissions.

💻 Affected Systems

Products:
  • needrestart
Versions: All versions before 3.8
Operating Systems: Linux distributions with needrestart package
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerable when needrestart runs with root privileges, which is common in default configurations after package updates or system restarts.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Local attacker gains full root access to the system, enabling complete compromise, data theft, persistence establishment, and lateral movement.

🟠

Likely Case

Privileged local users or attackers with initial foothold escalate to root to install malware, steal credentials, or pivot to other systems.

🟢

If Mitigated

With proper access controls and least privilege, impact is limited to isolated systems with no critical data exposure.

🌐 Internet-Facing: LOW - This is a local privilege escalation requiring existing access to the system.
🏢 Internal Only: HIGH - Internal attackers or compromised accounts can exploit this to gain root on affected systems.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires local access and ability to set environment variables before needrestart executes with root privileges.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.8 and later

Vendor Advisory: https://lists.debian.org/debian-lts-announce/2024/11/msg00014.html

Restart Required: No

Instructions:

1. Update needrestart package using system package manager. 2. For Debian/Ubuntu: sudo apt update && sudo apt install needrestart. 3. For other distributions, use appropriate package manager commands.

🔧 Temporary Workarounds

Remove PYTHONPATH environment variable

linux

Clear or restrict PYTHONPATH environment variable for needrestart execution

sudo systemctl edit needrestart.service
Add: Environment="PYTHONPATH="
sudo systemctl daemon-reload

Run needrestart without root privileges

linux

Configure needrestart to run with reduced privileges where possible

Edit needrestart configuration to use non-root user where functionality allows

🧯 If You Can't Patch

  • Restrict local user access to systems with needrestart installed
  • Implement strict environment variable controls and monitor for suspicious PYTHONPATH modifications

🔍 How to Verify

Check if Vulnerable:

Check needrestart version: dpkg -l | grep needrestart or rpm -q needrestart. If version is below 3.8, system is vulnerable.

Check Version:

dpkg -l | grep needrestart || rpm -q needrestart || needrestart --version

Verify Fix Applied:

Confirm needrestart version is 3.8 or higher after update. Test that PYTHONPATH manipulation no longer results in privilege escalation.

📡 Detection & Monitoring

Log Indicators:

  • Unusual PYTHONPATH environment variables in process execution logs
  • needrestart execution with modified environment variables
  • Unexpected root privilege escalation events

Network Indicators:

  • None - this is a local attack

SIEM Query:

process.name:"needrestart" AND env.PYTHONPATH:* OR process.parent.name:"needrestart" AND process.name:"python"

🔗 References

📤 Share & Export