Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-47187

CVE-2026-47187: SSHFS Path Traversal Vulnerability

CVE-2026-47187 is a path traversal flaw in SSHFS that allows rogue servers to exploit symlinks and access local files. This article covers the technical details, affected versions, impact, and mitigation steps.

Updated:

CVE-2026-47187 Overview

CVE-2026-47187 is a symlink handling vulnerability in SSHFS, a FUSE-based network filesystem client for connecting to SSH servers. A rogue SFTP server can return absolute symlink targets or relative targets containing parent-directory (..) components. SSHFS passes these targets through FUSE for resolution by the client kernel against the local filesystem. When a victim or victim-side tool follows such a link through tools such as cp, rsync, backups, or an editor, the server can read arbitrary local files or overwrite writable local files. The issue is fixed in version 3.7.6, which introduces the contain_symlinks option enabled by default.

Critical Impact

A malicious SFTP server can induce arbitrary local file reads and writes on connected SSHFS clients, potentially overwriting startup or scheduled-task files.

Affected Products

  • SSHFS versions prior to 3.7.6
  • libfuse SSHFS client (sshfs.c)
  • Any tooling using SSHFS to mount untrusted SFTP endpoints

Discovery Timeline

  • 2026-08-19 - CVE CVE-2026-47187 published to NVD
  • 2026-08-20 - Last updated in NVD database

Technical Details for CVE-2026-47187

Vulnerability Analysis

The vulnerability is a symlink-following flaw classified as [CWE-59] (Improper Link Resolution Before File Access). SSHFS translates SFTP readlink responses from the server into symlink targets exposed to the client kernel via FUSE. The client kernel then resolves these targets against the local filesystem, not the remote one, when programs traverse the returned link.

A malicious SFTP server can return a symlink whose target is an absolute path (for example, /etc/passwd) or a path containing .. components that escape the mount point. When a client-side program follows the link, the local kernel resolves it to a file on the victim's own machine. Read operations disclose file contents back to the server, while write operations place server-controlled data into local files.

The attack requires user interaction, typically the victim mounting an attacker-controlled SFTP endpoint and then running ordinary file operations such as cp -r, rsync, editors, or backup tooling across the mount.

Root Cause

SSHFS previously offered a transform_symlinks mitigation, but it did not contain relative targets. The function transform_symlink() at sshfs.c:2181 returns early for non-absolute targets, and sshfs_readlink() at sshfs.c:2234 to sshfs.c:2236 otherwise copies the server-supplied link target directly to the kernel without validating that it stays within the mount. Server-controlled .. sequences therefore reach the client kernel unchanged.

Attack Vector

An attacker operates a hostile SFTP server that the victim mounts with SSHFS. The server responds to readlink requests with crafted targets pointing outside the mount. When the victim runs standard filesystem operations that traverse the symlink, the local kernel dereferences the attacker-controlled path against the victim's local files.

c
// Security patch: add contain_symlinks option in sshfs.c
 	int fstat_workaround;
 	int createmode_workaround;
 	int transform_symlinks;
+	int contain_symlinks;
 	int follow_symlinks;
 	int no_check_root;
 	int detect_uid;

Source: GitHub Commit bcd132f

The patch introduces contain_symlinks, enabled by default, which rejects any symlink target that is absolute or contains .. components. Blocked reads return EPERM.

Detection Methods for CVE-2026-47187

Indicators of Compromise

  • SSHFS mounts pointing to untrusted or unexpected SFTP servers
  • Symlinks inside SSHFS mount points whose readlink output resolves outside the mount (absolute paths or paths containing ..)
  • Unexpected reads or writes to sensitive local files (for example, ~/.ssh/authorized_keys, ~/.bashrc, cron files) shortly after SSHFS activity

Detection Strategies

  • Audit installed SSHFS package versions and flag any host running a version earlier than 3.7.6
  • Monitor process activity for sshfs invocations followed by traversal tools such as cp, rsync, tar, or backup agents against the mount
  • Inspect symlink targets under SSHFS mounts using find <mount> -type l -exec readlink {} \; and alert on absolute paths or .. sequences

Monitoring Recommendations

  • Enable Linux audit rules for openat and readlinkat syscalls originating from processes accessing FUSE mounts
  • Log SSHFS mount events and correlate with subsequent access to files outside the mount by the same user
  • Alert on outbound SFTP writes containing content from sensitive local paths

How to Mitigate CVE-2026-47187

Immediate Actions Required

  • Upgrade SSHFS to version 3.7.6 or later on all clients
  • Unmount and avoid connecting to untrusted SFTP servers until patched
  • Review any automation, backup, or synchronization job that traverses SSHFS mounts and pause those touching untrusted endpoints

Patch Information

The fix is available in SSHFS release 3.7.6. The patch introduces the contain_symlinks option, enabled by default, which rejects symlink targets that are absolute or contain .. components and returns EPERM for blocked reads. See the GitHub Security Advisory GHSA-pjv6-2c3f-r357 and pull request #361 for details.

Workarounds

  • Only mount SSHFS filesystems from fully trusted SFTP servers under administrator control
  • Avoid combining transform_symlinks with contain_symlinks; transformed targets often contain .. and would be rejected
  • Do not use no_contain_symlinks unless the server is fully trusted
  • Restrict SSHFS mount points to unprivileged users and avoid running root-level backup or copy tooling across untrusted mounts
bash
# Mount SSHFS with symlink containment (default in 3.7.6+)
sshfs user@server:/remote/path /mnt/point -o contain_symlinks

# Verify installed version
sshfs --version

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.