GNU Screen contains a Time-of-Check/Time-of-Use (TOCTOU) race condition vulnerability in its hardcopy file handler. The flaw arises because write permissions are checked using the real user ID, but the file is opened using the effective user ID. This discrepancy allows a local unprivileged attacker to replace the target file path with a symbolic link to an arbitrary system file during the race window. Exploiting this vulnerability can lead to writing arbitrary files with root privileges, resulting in local privilege escalation. The issue was fixed in GNU Screen version 5.0.2.