Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-108976 Overview
CVE-2026-108976 is an operating system command injection vulnerability in GNU Emacs before version 31.2 and the TRAMP package through 2.8.2. The flaw resides in the tramp-user-regexp component, which maintains an incomplete list of disallowed inputs. Attackers can craft a malicious filename that bypasses this filter and executes arbitrary OS commands when processed by TRAMP. The issue is a direct consequence of an incomplete fix for CVE-2026-79992, meaning prior remediation did not fully close the injection path. The weakness is classified under [CWE-184: Incomplete List of Disallowed Inputs].
Critical Impact
Local attackers can achieve arbitrary command execution with the privileges of the Emacs user by inducing TRAMP to process a crafted filename.
Affected Products
- GNU Emacs versions prior to 31.2
- GNU TRAMP versions through 2.8.2
- Linux and Unix-like systems running vulnerable Emacs/TRAMP builds
Discovery Timeline
- 2026-08-21 - Initial discussion published on the OpenWall OSS-Security mailing list
- 2026-10-11 - CVE-2026-108976 published to NVD; follow-up OSS-Security message released
- 2026-10-16 - Last updated in NVD database
Technical Details for CVE-2026-108976
Vulnerability Analysis
TRAMP (Transparent Remote Access, Multiple Protocols) is the Emacs subsystem that enables editing files over remote protocols such as SSH, SCP, and sudo. It parses remote filenames in the form /method:user@host:/path, extracting the user component using the tramp-user-regexp pattern. When this regular expression accepts characters it should reject, the parsed user field can be interpolated into shell commands constructed by TRAMP for the remote operation.
The prior fix for CVE-2026-79992 addressed several disallowed characters but omitted additional metacharacters that shells interpret. A filename containing an attacker-controlled user segment can therefore break out of the intended argument boundary and append arbitrary commands. Execution occurs locally within the context of the Emacs process.
Root Cause
The root cause is an incomplete deny list in tramp-user-regexp [CWE-184]. The regular expression permits characters that carry shell semantics, allowing injection into command strings constructed for remote protocol handlers. The pattern should have enforced a strict allow list of safe username characters rather than enumerating forbidden ones.
Attack Vector
Exploitation requires an attacker to deliver a crafted filename that the victim's Emacs session opens or evaluates through TRAMP. This can occur through project files, directory listings, find-file prompts, Dired operations, or Lisp expressions in untrusted content. When TRAMP parses the filename, the embedded shell metacharacters execute as commands with the privileges of the Emacs user. The attack vector is local and requires low privileges with no user interaction beyond opening the file. For technical details, see the OpenWall OSS-Security advisory from October 2026.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-108976
Indicators of Compromise
- Unexpected child processes spawned by emacs such as /bin/sh, bash, or network utilities
- Shell history or audit logs showing TRAMP-style filenames containing backticks, $(, ;, |, or & in the user field
- Outbound connections initiated from an Emacs process to unknown hosts shortly after a file-open event
- Modification of user profile files (.bashrc, .ssh/authorized_keys) correlated with Emacs activity
Detection Strategies
- Monitor process-ancestry telemetry for emacs spawning shells or interpreters, which is anomalous for most editing workflows
- Alert on command-line arguments containing TRAMP syntax combined with shell metacharacters
- Correlate file-open events against baseline user behavior to flag filenames with embedded protocol specifiers from untrusted sources
Monitoring Recommendations
- Enable Linux auditd rules covering execve syscalls where the parent process is emacs
- Track installed Emacs and TRAMP package versions across the fleet to identify systems below 31.2 or TRAMP 2.8.2
- Review shared project repositories for files or directory names containing suspicious TRAMP strings
How to Mitigate CVE-2026-108976
Immediate Actions Required
- Upgrade GNU Emacs to version 31.2 or later on all affected hosts
- Upgrade the standalone TRAMP package beyond version 2.8.2 where it is installed independently
- Audit development and administrative workstations where Emacs is used to open untrusted repositories
- Restrict Emacs usage to trusted file sources until patching is complete
Patch Information
The fix is included in GNU Emacs 31.2 and in TRAMP releases following 2.8.2. The patched tramp-user-regexp enforces a stricter character set for the user component. Updated sources are available from the GNU TRAMP distribution site and through standard Linux distribution package channels once vendors publish updated builds.
Workarounds
- Disable or avoid loading TRAMP in init.el where remote file editing is not required: (setq tramp-mode nil)
- Decline to open filenames or project directories from untrusted sources, especially those containing : or @ characters
- Set enable-local-variables to nil to prevent processing of file-local variable blocks in untrusted files
# Configuration example
# Verify installed Emacs version
emacs --version | head -n1
# Disable TRAMP at startup until patched version is deployed
echo '(setq tramp-mode nil)' >> ~/.emacs.d/init.el
# Debian/Ubuntu example once patched package is released
sudo apt update && sudo apt install --only-upgrade emacs
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

