Summery
CVE-2023-26604 is a vulnerability in systemd before 247 which do not adequately block local privilege escalation for some Sudo configurations, e.g., plausible sudoers files in which the “systemctl status” command may be executed. Specifically, systemd does not set LESSSECURE to 1, and thus other programs may be launched from the less program. This presents a substantial security risk when running systemctl from Sudo, because less executes as root when the terminal size is too small to show the complete systemctl output.
Affected versions:
systemd before 247
Exploitation
It’s very case dependent, but building on the Sau example:
- Run
sudo systemctl status service - Systemctl is opened with less
- You enter
:shor:/bin/bash - You have access as root, because less inherits root privileges from systemd