Commit Graph

693 Commits

Author SHA1 Message Date
Matthias Gerstner
161f85b98b fix CVE-2025-46805: socket.c - don't send signals with root privileges
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.
2025-05-12 15:38:19 +02:00
Matthias Gerstner
e0eef5aac4 fix CVE-2025-46804: avoid file existence test information leaks
In setuid-root context the current error messages give away whether
certain paths not accessible by the real user exist and what type they
have. To prevent this only output generic error messages in setuid-root
context.

In some situations, when an error is pertaining a directory and the
directory is owner by the real user then we can still output more
detailed diagnostics.

This change can lead to less helpful error messages when Screen is
install setuid-root. More complex changes would be needed to avoid this
(e.g.  only open the `SocketPath` with raised privileges when
multi-attach is requested).

There might still be lingering some code paths that allow such
information leaks, since `SocketPath` is a global variable that is used
across the code base. The majority of issues should be caught with this
fix, however.
2025-05-12 15:26:11 +02:00
Matthias Gerstner
049b26b22e fix CVE-2025-46802: attacher.c - prevent temporary 0666 mode on PTYs
This temporary chmod of the PTY to mode 0666 is most likely a remnant of
past times, before the PTY file descriptor was passed to the target
session via the UNIX domain socket.

This chmod() causes a race condition during which any other user in the
system can open the PTY for reading and writing, and thus allows PTY
hijacking.

Simply remove this logic completely.
2025-05-12 15:15:38 +02:00
Alexander Naumov
8a4124d5de Release v.4.9.1 v.4.9.1 2023-08-16 02:11:00 +02:00
Alexander Naumov
332aae3c13 documentation fix: inconsistency about MAXWIN
bug#64504
2023-08-12 00:43:52 +02:00
Alexander Naumov
e2ffa4f0a8 manpage has misleading bash example
bug#64378
2023-08-12 00:23:29 +02:00
Carl Drougge
acb21f5269 doc: printing is disabled with \e[4i, not ST 2023-08-09 23:08:25 +02:00
Alexander Naumov
bca16ae1a0 Thanks a lot for our contributors 2023-08-09 23:04:33 +02:00
Alexander Naumov
ef5f51e4ea Texinfo Mousetrack node points to wrong top node
bug#64518
2023-08-09 22:05:32 +02:00
Alexander Naumov
7bc03a8e39 Typos in screen.texinfo and screen.1 manpage
bug#64086
2023-08-09 15:03:28 +02:00
Alexander Naumov
a7682a2bf1 Update man page and info manual: lockscreen program
Command "lockscreen" doesn't use /local/bin/lck
or /usr/bin/lock, but just program from the LOCKPRG
environment variable.

bug #63970
2023-08-05 12:45:04 +02:00
Carl Drougge
6cb6fe5213 fix build warnings: unused-but-set-variable 2023-07-27 23:10:07 +02:00
Alexander Naumov
7315ca28f3 removing old patches (already applied) 2023-07-27 22:49:28 +02:00
Carl Drougge
7b7c2c85af fix warnings: Potential buffer overruns 2023-07-25 17:26:18 +02:00
Alexander Naumov
5e91ed70a6 Code Reformating: acls.c 2023-07-18 12:19:38 +02:00
Alexander Naumov
98677d5bf5 configure: add needed system headers in checks and return values for implicit function declarations
Newer compilers throw warnings when a funciton is used with implicit
declaration and enabling -Werror can silently fail these tests and
result in wrong configure results.
Therefore add the needed headers in the AC_TRY_LINK macros

Upstream variant:
https://lists.gnu.org/archive/html/screen-devel/2022-08/msg00000.html

Fix several implicit function declarations and implicit
int return types in the configure script.
This ensures that the package continuesto build with future compilers
which do not support these by default.

Posted upstream:
https://lists.gnu.org/archive/html/screen-devel/2023-03/msg00001.html

Tested with clang 16.0.6 x86_64.

Thanks to:
Khem Raj <raj.khem@gmail.com>
Arjun Shankar <arjun@redhat.com>
Nicholas Vinson <nvinson234@gmail.com>
2023-07-14 16:09:31 +02:00
Alexander Naumov
fd6c263af2 Code Reformating: misc.c 2023-07-04 14:15:22 +02:00
Alexander Naumov
027bc6d470 check crypt output for SaveStr() 2023-02-01 13:32:20 +02:00
Alexander Naumov
e9ad41bfed fix: missing signal sending permission check on failed query messages
Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
2023-01-30 17:22:25 +02:00
Alexander Naumov
531d09e92a removing old patch (already applied) 2023-01-23 00:53:27 +02:00
Carl Drougge
1fcaf1de6d fix build DEBUG warnings
bug #62116
2023-01-23 00:12:25 +02:00
Alexander Naumov
dfd9b92fbf update copyright year (22=>23) 2023-01-23 00:10:58 +02:00
Alexander Naumov
cd8c16e995 NULL Pointer Dereference fix
Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org>
2023-01-22 22:11:40 +02:00
Josef Ridky
3ce7745a9e Fix: typo in braille_tsi.c
bug #62155
2023-01-20 23:00:19 +02:00
Jaak Ristioja
1ec8838c4b man page: Fixed some typos 2022-11-17 14:14:43 +02:00
Carl Drougge
916d052313 [PATCH] encoding: Replace out of range unicode with U+FFFD
Also correct the mask for four byte UTF-8.

bug #62097
2022-02-23 16:23:22 +02:00
Vincent Lefevre
1bfe555cd3 Avoid zombies after shell exit
As documented in libutempter:
"During execution of the privileged process spawned by these
functions, SIGCHLD signal handler will be temporarily set to
the default action."

Thus in case a SIGCHLD has been lost, we send a SIGCHLD to
oneself in order to avoid zombies:
https://savannah.gnu.org/bugs/?25089
2022-02-17 02:42:31 +02:00
René Genz
7da80e460b [PATCH] fix typing errors 2022-02-15 19:42:57 +02:00
David Kerns
8b386d8dec Support stop/parity bits on serial port
bug #23952

Unfortunately, screen's handling of serial ports is
somewhat incomplete: You can set the baud rate and the
word length (cs7), but not the number of stop bits
and/or the parity settings.

Since the OS calls are readily available, adding this
to a future version of screen would proably be easy
enough to do inside tty.sh.
2022-02-09 23:33:00 +02:00
Alexander Naumov
afa966c788 Release v.4.9.0 v.4.9.0 2022-01-28 16:04:19 +02:00
René Genz
c5d53d69c0 [PATCH] fix typing errors 2022-01-28 15:47:09 +02:00
Alexander Naumov
797df7aa0d reformating Changelog 2022-01-25 15:55:06 +02:00
Alexander Naumov
4fa8eb20f2 update release version 2022-01-24 01:15:52 +02:00
Stuart Henderson
d5672bac2d OpenBSD fix: including utils.h for openpty() 2022-01-24 00:41:51 +02:00
Alexander Naumov
d591a396c7 bugfix: session names limit is 80 symbols
bug #61534

Screen allowed you to specify a long session name
(without any errors), but didn't run if session name
was too long.

This fix sets limit for 80 symbols and doesn't allow
to use session names longer then this limit.
Screen should print error message in case of too long
session name.
2022-01-20 18:21:33 +02:00
Michael Witten
a13ee11b25 [PATCH] build: autogen.sh: Use '-i' and remove 'exec'
* Add the '-i' ('--install') flag; this resolves ticket #60751.

* Remove the spurious 'exec', which causes the shell script to be
  replaced entirely with the 'autoreconf' process, and thus prevents
  the rest of the script from being run; after this commit, the
  director 'autom4te.cache' does actually get removed.

Reported-by: Tushar T <sukucorp>
2022-01-18 22:29:38 +02:00
Alexander Naumov
2dc7d0ce2b compiler -Wpointer-sign warning fix 2022-01-15 06:46:44 +02:00
Alexander Naumov
1176586e72 strlen_onscreen() expects unsinged char * 2022-01-15 06:43:32 +02:00
Alexander Naumov
19d60fc562 Code Reformating: mark.c 2022-01-15 06:41:07 +02:00
Alexander Naumov
70f794ae39 Code Refactoring: fileio.c 2022-01-15 06:02:26 +02:00
Stuart Henderson
c1217dcee9 fix data type for ioctl() in osdef.h.in 2022-01-15 04:46:23 +02:00
Roland Illig
c43fb85a2d fix: array subscript has type 'char' 2022-01-15 04:04:40 +02:00
Alexander Naumov
191567a245 Code Reformating: braille_tsi.c 2022-01-15 03:55:53 +02:00
Alexander Naumov
a2fd0f7e12 Code Reformating: sched.c 2022-01-08 17:07:34 +02:00
Alexander Naumov
0cbf46c5f8 doc: screen.textinfo 4.9.0 update 2022-01-08 17:05:30 +02:00
Axel Beckert
4e4f07fea0 doc: fix spelling errors found by lintian 2022-01-08 02:33:43 +02:00
Alexander Naumov
821d888e29 doc: add info about new hardstatus escape %e 2022-01-07 20:42:16 +02:00
Yi-Jheng Lin
491203b275 new hardstatus option %e - currently used encoding 2022-01-07 20:16:59 +02:00
Alexander Naumov
19e44115eb Code Reformating: search.c 2022-01-06 22:11:09 +02:00
Alexander Naumov
7908c33f73 exit_with_usage() return 1 in error case only
"screen -h|--help" should NOT return 1
2022-01-06 21:42:55 +02:00