# GNU Screen vulnerabilities before 5.0.2: buffer overflow (CVE-2026-71409), use-after-free (CVE-2026-71410), TOCTOU local privilege escalation (CVE-2026-71411)

> CERT Polska disclosed three vulnerabilities in GNU Screen affecting all versions before 5.0.2: a global buffer overflow in SendCmdMessage() (CWE-120), a use-after-free in utf8_handle_comb() (CWE-416), and a TOCTOU race in the hardcopy file handler enabling arbitrary file writes as root and local privilege escalation (CWE-367). All are fixed in 5.0.2.

- **Published:** 2026-11-26T14:16:49Z
- **Last reviewed:** 2026-11-26T14:16:49Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-6932
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-6932.png
- **ID:** TL-2026-6932
- **Severity:** HIGH
- **Category:** VULNERABILITY
- **Status:** PATCHED
- **Detections:** 9 (1 shown free below) · **IOCs:** 4
- **CVEs:** CVE-2026-71409, CVE-2026-71410, CVE-2026-71411, CVE-2025-46805

## Description

CERT Polska published a coordinated advisory on 2026-11-26 covering three flaws in GNU Screen, the terminal multiplexer. All versions before 5.0.2 are affected and all three issues are fixed in 5.0.2. The issues were reported to CERT Polska by Michał Majchrowicz and Marcin Wyczechowski of the AFINE Team.

CVE-2026-71409 (CWE-120) is a global buffer overflow in SendCmdMessage() in attacher.c. An unchecked sprintf() call appends the STY environment variable to the global SocketPath buffer. If Screen runs in an environment where HOME and STY hold attacker-controlled, sufficiently long values, the overflow can cause an application crash or potentially arbitrary code execution.

CVE-2026-71410 (CWE-416) is a use-after-free in utf8_handle_comb() in encoding.c. Improper error handling after a memory-allocation failure leaves the global combchars pointer freed but not reset to NULL; a subsequent combining Unicode character causes the freed pointer to be dereferenced. The advisory states that an attacker controlling terminal content sent to the Screen session (for example via a rogue SSH server or crafted escape sequences) can use heap grooming to achieve arbitrary code execution.

CVE-2026-71411 (CWE-367) is a time-of-check/time-of-use race in the hardcopy file handler. Write permission is checked with the real user ID but the file is then opened with the effective user ID, so a local unprivileged attacker who wins the race can replace the target path with a symbolic link to an arbitrary system file and cause a write with root privileges, leading to local privilege escalation.

The source does not state a CVSS score, in-the-wild exploitation, a public proof of concept, IOCs, or threat-actor attribution. NVD had no record for CVE-2026-71411 at the time of research, and the CVEs were not found in the CISA KEV catalog (catalog version 2026.11.25; only partially read). The HIGH severity is the analyst's assessment based on the stated root privilege escalation and potential code-execution impact. This is a patch-and-hunt item, not an observed campaign.

## MITRE ATT&CK

- T1548.001 Abuse Elevation Control Mechanism: Setuid and Setgid
- T1203 Exploitation for Client Execution
- T1565.001 Data Manipulation: Stored Data Manipulation
- T1499.004 Endpoint Denial of Service: Application or System Exploitation

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**Root-Effective Write to Identity or Persistence Files from Non-Root Login Session (Post-Exploitation of Screen LPE)** (`TL-2026-6932-SPL-002`)

Detects files that control accounts, sudo, cron, PAM or systemd units being written with effective UID 0 by a binary outside the normal administration tooling, in a session whose audit login UID is a non-root user. This is the post-exploitation footprint of an arbitrary root file write such as CVE-2026-71411, used to plant accounts, sudoers entries, cron jobs or units. screen_involved flags when the writer is the screen binary.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1068, T1565.001, T1136.001, T1053.003
- **Data sources:** linux auditd (index=linux sourcetype=linux_audit), DeviceFileEvents, DeviceProcessEvents, sysmon for linux file_event
- **Severity:** high
- **Confidence:** medium

### Splunk SPL

````spl
index=linux sourcetype=linux_audit (type=SYSCALL OR type=PATH) ```post-exploitation of CVE-2026-71411 screen LPE: root write to identity or persistence files from a non-root login session```
| eval audit_id=mvindex(split(mvindex(split(_raw,"msg=audit("),1),")"),0)
| stats min(_time) as first_seen values(exe) as exe values(uid) as uid values(euid) as euid values(auid) as auid values(syscall) as syscall values(name) as paths by host audit_id
| where isnotnull(mvfind(euid,"^0$")) AND isnull(mvfind(auid,"^(0|4294967295|unset)$"))
| where mvcount(mvfilter(match(paths,"^/(etc/(passwd|shadow|group|gshadow|sudoers|sudoers[.]d/.*|ld[.]so[.]preload|crontab|cron[.].*|pam[.]d/.*)|var/spool/cron/.*|(etc|usr/lib|lib)/systemd/system/.*|root/[.]ssh/authorized_keys)$")))>0
| where NOT match(mvjoin(exe,","),"/(useradd|usermod|userdel|groupadd|passwd|chpasswd|chage|vipw|vigr|visudo|sudoedit|crontab|dpkg|rpm|apt|apt-get|yum|dnf|systemctl|ansible|puppet|chef-client|salt-minion)(,|$)")
| eval screen_involved=if(match(mvjoin(exe,","),"/screen(,|$)"),"yes","no")
| eval first_seen=strftime(first_seen,"%Y-%m-%dT%H:%M:%S")
| table first_seen host audit_id exe uid euid auid paths screen_involved
````

### Microsoft KQL

```kql
// Root file write at identity/persistence paths shortly after a non-root user ran screen (CVE-2026-71411 post-exploitation)
let SensitivePaths = dynamic(["/etc/passwd","/etc/shadow","/etc/group","/etc/gshadow","/etc/sudoers","/etc/ld.so.preload","/etc/cron","/var/spool/cron","/etc/systemd/system","/usr/lib/systemd/system","/lib/systemd/system","/root/.ssh/authorized_keys","/etc/pam.d"]);
let ScreenRuns = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "screen"
| where AccountName !~ "root"
| project DeviceName, ScreenTime = Timestamp, ScreenUser = AccountName, ScreenCmd = ProcessCommandLine;
DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where InitiatingProcessAccountName =~ "root"
| where FolderPath has_any (SensitivePaths)
| where InitiatingProcessFileName !in~ ("useradd", "usermod", "userdel", "groupadd", "passwd", "chpasswd", "vipw", "visudo", "crontab", "dpkg", "rpm", "apt", "apt-get", "yum", "dnf", "systemctl")
| join kind=inner ScreenRuns on DeviceName
| where Timestamp between (ScreenTime .. (ScreenTime + 15m))
| project Timestamp, DeviceName, FolderPath, InitiatingProcessFileName, InitiatingProcessCommandLine, ScreenUser, ScreenCmd, ScreenTime
```

### Sigma

```yaml
title: Root Write To Account Or Persistence File By Screen Or Unexpected Binary
id: 9e2d4c71-3a85-4b0e-8f16-7c3b5d2a90e4
status: experimental
description: Detects a root-owned process other than standard administration tools modifying account, sudo, cron, PAM, ld.so.preload or systemd unit files, the post-exploitation footprint of a root arbitrary file write such as GNU Screen CVE-2026-71411.
references:
  - https://cert.pl/en/posts/2026/11/CVE-2026-71409/
author: Threadlinqs Team
date: 2026-11-26
tags:
  - attack.privilege-escalation
  - attack.t1068
  - attack.persistence
  - attack.t1136.001
  - attack.t1053.003
  - attack.impact
  - attack.t1565.001
  - cve.2026-71411
logsource:
  category: file_event
  product: linux
detection:
  selection:
    User: 'root'
    TargetFilename|startswith:
      - '/etc/passwd'
      - '/etc/shadow'
      - '/etc/sudoers'
      - '/etc/ld.so.preload'
      - '/etc/cron'
      - '/var/spool/cron/'
      - '/etc/systemd/system/'
      - '/usr/lib/systemd/system/'
      - '/root/.ssh/authorized_keys'
  filter_admin_tools:
    Image|endswith:
      - '/useradd'
      - '/usermod'
      - '/userdel'
      - '/passwd'
      - '/chpasswd'
      - '/vipw'
      - '/visudo'
      - '/crontab'
      - '/dpkg'
      - '/rpm'
      - '/apt'
      - '/apt-get'
      - '/dnf'
      - '/yum'
      - '/systemctl'
  condition: selection and not filter_admin_tools
falsepositives:
  - Configuration management agents (Ansible, Puppet, Salt, Chef) writing these files
  - Installers and custom deployment scripts running as root
level: medium
```

**Known false positives:**

- Configuration management agents and deployment scripts writing these files as root from a non-root login session
- Admin using sudo with an editor (vim, nano) on /etc files, which keeps auid non-root and euid 0

**Tuning notes:** Add editors and automation binaries used in your estate to the exclusion list, or key on auid of known admin accounts. This is a generic result-of-LPE detection; the SPL form is primary and the KQL form is narrowed to a 15 minute window after a non-root screen execution. Extend the path list with environment-specific sensitive files.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- GNU [indicator] Hardcopy Invoked Against Sensitive System Path (CVE-2026-71411) (locked: unlock with TL Creds)
- Symlink Created Toward Sensitive System File by Non-Root User (CVE-2026-71411 Race Setup) (locked: unlock with TL Creds)
- Oversized STY or HOME Environment Value Passed to [indicator] (CVE-2026-71409 Buffer Overflow Precondition) (locked: unlock with TL Creds)
- SUID or SGID Bit Set on File in User-Writable Location ([indicator] LPE Post-Exploitation) (locked: unlock with TL Creds)
- UID 0 Account Created via useradd or usermod -o (Root File Write Persistence) (locked: unlock with TL Creds)
- GNU [indicator] Core Dump Recorded by systemd-coredump (Memory Corruption Exploit Attempt) (locked: unlock with TL Creds)
- GNU [indicator] Root-Effective Write to Sensitive System Path (CVE-2026-71411 Hardcopy TOCTOU) (locked: unlock with TL Creds)
- GNU [indicator] Process Crash or Heap Corruption Abort (CVE-2026-71409 / CVE-2026-71410 Exploit Attempts) (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sources

- [CERT Polska: Vulnerabilities in GNU Screen software](https://cert.pl/en/posts/2026/11/CVE-2026-71409/)
- [CVE-2026-71409 CVE record](https://www.cve.org/CVERecord?id=CVE-2026-71409)
- [CVE-2026-71410 CVE record](https://www.cve.org/CVERecord?id=CVE-2026-71410)
- [CVE-2026-71411 CVE record](https://www.cve.org/CVERecord?id=CVE-2026-71411)
- [CWE-120: Buffer Copy without Checking Size of Input](https://cwe.mitre.org/data/definitions/120.html)
- [CWE-416: Use After Free](https://cwe.mitre.org/data/definitions/416.html)
- [CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition](https://cwe.mitre.org/data/definitions/367.html)
- [CERT Polska Coordinated Vulnerability Disclosure program](https://cert.pl/en/cvd/)
- [openSUSE: Multiple Security Issues in Screen (prior related Screen issues, CVE-2025-46805)](https://security.opensuse.org/2025/05/12/screen-security-issues.html)
- [oss-security: Screen security issues / 5.0.2 release discussion](https://www.openwall.com/lists/oss-security/2025/05/16/1)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-6932
