mirror of
https://git.savannah.gnu.org/git/screen.git
synced 2026-02-10 01:12:06 +02:00
screen-v4
The CheckPid() function was introduced to address CVE-2023-24626, to prevent sending SIGCONT and SIGHUP to arbitrary PIDs in the system. This fix still suffers from a TOCTOU race condition. The client can replace itself by a privileged process, or try to cycle PIDs until a privileged process receives the original PID. To prevent this, always send signals using the real privileges. Keep CheckPid() for error diagnostics. If sending the actual signal fails later on then there will be no more error reporting. It seems the original bugfix already introduced a regression when attaching to another's user session that is not owned by root. In this case the target sessions runs with real uid X, while for sending a signal to the `pid` provided by the client real uid Y (or root privileges) are required. This is hard to properly fix without this regression. On Linux pidfds could be used to allow safely sending signals to other PIDs as root without involving race conditions. In this case the client PID should also be obtained via the UNIX domain socket's SO_PEERCRED option, though.
Description
Screen is a full-screen window manager that multiplexes a physical
terminal between several processes, typically interactive shells
Languages
C
76.7%
Roff
14.1%
PostScript
6%
Shell
1.4%
Makefile
1.1%
Other
0.7%