CVE-2025-23395
Linux Red Hat vulnerability analysis and mitigation

Overview

CVE-2025-23395 is a critical security vulnerability discovered in GNU Screen version 5.0.0 that enables local privilege escalation to root access. The vulnerability affects installations where Screen is configured with setuid-root privileges, primarily impacting Arch Linux and NetBSD systems. The issue was discovered during a comprehensive security audit by the SUSE Security Team and was disclosed in May 2025 (SecurityOnline, OpenWall).

Technical details

The vulnerability exists in the logfile_reopen() function which fails to drop elevated privileges while operating on user-supplied paths. The issue was introduced via commit 441bca708bd and became part of the 5.0.0 release. When triggered, it allows unprivileged users to create files in arbitrary locations with root ownership, the invoking user's real group ownership, and file mode 0644. The vulnerability can be exploited when Screen believes it needs to reopen the logfile, which occurs when the link count of the originally opened logfile drops to zero or if it unexpectedly changes in size (OpenWall).

Impact

The vulnerability allows attackers to achieve local privilege escalation by creating files with root ownership in arbitrary locations. This can be exploited to write new configuration files for tools like sudo, append code to privileged shell scripts, or manipulate other sensitive system files. All data written to the Screen PTY will be logged into the compromised file, potentially leading to system compromise (SecurityOnline).

Mitigation and workarounds

The issue has been addressed with a patch that reintroduces secure file handling during logfile reopen. SUSE strongly advises against installing Screen with setuid-root privileges. For systems that require multi-user support, it is recommended to implement it as an opt-in feature, possibly restricted to a trusted group. Distributions should explicitly pass the configure switch --with-pty-mode=0620 to ensure safe default permissions (OpenWall).

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