CVE-2026-71409: Global Buffer Overflow in GNU screen
GNU screen is vulnerable to a global buffer overflow in the SendCmdMessage() function within attacher.c. Due to the use of an unchecked sprintf() call when appending the STY environment variable to the global SocketPath buffer. The vulnerability occurs when GNU screen is executed in an environment where the HOME and STY environment variables contain attacker-controlled values that are sufficiently long. Successful exploitation may result in an application crash or potentially arbitrary code execution.
This issue was fixed in version 5.0.2.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 5.0.2
Event History
Frequently Asked Questions
Who is realistically exposed to exploitation?
Systems running GNU screen before version 5.0.2 are exposed when it is launched with attacker-controlled HOME and STY environment variable values that are sufficiently long. This is most relevant where an attacker can influence the environment of a GNU screen process.
What does an attacker need to trigger the issue?
The attacker needs control over both the HOME and STY environment variables in the environment used to execute GNU screen, and the values must be long enough to overflow the global SocketPath buffer.
Are users of GNU screen 5.0.2 affected?
No. The issue is fixed in GNU screen version 5.0.2.
What can be done if upgrading is not immediately possible?
Prevent untrusted parties from controlling the HOME or STY values supplied when GNU screen is executed, particularly long values. Restrict execution contexts that inherit attacker-influenced environment variables.