CVE-2023-26604
NixOS vulnerability analysis and mitigation

Overview

A local privilege escalation vulnerability (CVE-2023-26604) was discovered in systemd versions before 247. The vulnerability exists because systemd does not set LESSSECURE to 1 when executing the 'systemctl status' command through sudo, allowing other programs to be launched from the less program when running as root. This presents a security risk particularly when the terminal size is too small to show complete systemctl output (Debian LTS, NVD).

Technical details

The vulnerability occurs when systemd fails to check the effective user ID (eUID) and user ID (UID) in version 245 and earlier. When systemctl status output is larger than the terminal size, it uses the 'less' pager program to display the content. Since LESSSECURE is not set to 1, users can execute commands through less's shell escape feature (!sh) while running with root privileges. This vulnerability is particularly concerning when systemctl status commands are allowed through sudo configurations (Medium Blog).

Impact

Successful exploitation of this vulnerability could lead to local privilege escalation, allowing an attacker to execute commands with root privileges. This can result in disclosure of sensitive information, addition or modification of data, or Denial of Service (DoS) (NetApp Security).

Mitigation and workarounds

The vulnerability has been fixed in systemd version 247 and later, which adds safeguards to prevent command execution if the eUID differs from the UID. The fix includes setting LESSSECURE=1 when sudo execution is detected, disabling the ability to invoke external programs from the pager. This behavior can be overridden using the SYSTEMD_PAGERSECURE environment variable (Medium Blog).

Additional resources


SourceThis report was generated using AI

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management