CVE-2026-54706 Overview
CVE-2026-54706 is a symbolic link following vulnerability in OnionShare, an open source tool for anonymous file sharing, website hosting, and chat over the Tor network. Versions prior to 2.6.4 follow symbolic links in cli/onionshare_cli/web/send_base_mode.py through the SendBaseModeWeb.set_file_info() and stream_individual_file() functions. Remote recipients in Share or Website mode can read local files outside the selected directory. The issue is tracked under [CWE-59] (Improper Link Resolution Before File Access) and is fixed in version 2.6.4.
Critical Impact
Remote recipients connecting through a Tor onion service can read arbitrary local files outside the shared directory by exploiting symlinks the OnionShare CLI or Desktop client resolves during file streaming.
Affected Products
- OnionShare CLI versions prior to 2.6.4
- OnionShare Desktop versions prior to 2.6.4
- OnionShare Share Mode and Website Mode components
Discovery Timeline
- 2026-07-31 - CVE-2026-54706 published to NVD
- 2026-07-31 - Last updated in NVD database
Technical Details for CVE-2026-54706
Vulnerability Analysis
OnionShare exposes files selected by the host over a Tor onion service. When a sender selects a directory to share, the OnionShare web layer enumerates its contents through SendBaseModeWeb.set_file_info() and streams individual files with stream_individual_file(). Both functions dereference symbolic links present in the selected directory instead of restricting access to the intended tree.
A sender who unknowingly includes a symlink, or an attacker who tricks a sender into adding a crafted directory, can cause OnionShare to serve files anywhere the OnionShare process has read access. Remote recipients then download those out-of-scope files through the normal HTTP interface exposed on the onion address.
The issue affects both Share Mode, which allows recipients to download shared files, and Website Mode, which serves a static site from a directory. Exploitation requires the sender to include (or be tricked into including) a symlink and requires user interaction with the shared onion service.
Root Cause
The file handling logic in send_base_mode.py performs no check to confirm that resolved paths remain within the selected root directory. Python file operations follow symbolic links by default, and the affected functions do not call os.path.realpath() comparisons or use os.lstat() to reject symlinks before adding them to the served file list.
Attack Vector
An attacker with the onion address served by a vulnerable OnionShare instance requests the symlinked path through the Tor-exposed HTTP endpoint. The OnionShare process opens the target of the symlink and streams its contents back to the attacker. The attacker is limited to files readable by the user running OnionShare, but this typically includes sensitive material such as SSH keys, browser profiles, and personal documents.
// Patch excerpt from cli/onionshare_cli/web/share_mode.py
return range_, status_code
- def generate(
- self, range_, file_to_download, path, history_id, filesize
- ):
+ def generate(self, range_, file_to_download, path, history_id, filesize):
# The user hasn't canceled the download
self.client_cancel = False
Source: GitHub Commit 48f31cf
Detection Methods for CVE-2026-54706
Indicators of Compromise
- HTTP request logs on the OnionShare instance showing download paths that resolve outside the intended share directory
- Presence of symbolic links inside directories selected for OnionShare Share or Website mode
- OnionShare process file descriptors opened against paths outside the advertised share root
- Unexpected read access to sensitive files (SSH keys, credential stores, home directory dotfiles) coinciding with an active OnionShare session
Detection Strategies
- Audit directories selected for sharing for symlinks using find <path> -type l before starting an OnionShare session
- Monitor OnionShare application logs for file paths that differ from the configured share root
- Correlate OnionShare process file access (via auditd, EDR file telemetry, or eBPF) with the declared share directory
- Track installed OnionShare versions across managed endpoints and flag versions earlier than 2.6.4
Monitoring Recommendations
- Alert on file reads by the OnionShare process outside the user-selected share directory
- Log all HTTP requests handled by the OnionShare web server for post-incident review
- Track outbound Tor connections initiated by OnionShare on endpoints where the tool is not sanctioned
- Maintain an inventory of endpoints running OnionShare and validate they are updated to 2.6.4 or later
How to Mitigate CVE-2026-54706
Immediate Actions Required
- Upgrade OnionShare CLI and Desktop to version 2.6.4 or later on all endpoints
- Stop any active Share or Website mode sessions running on vulnerable versions until upgraded
- Review directories previously shared through OnionShare for symlinks that may have exposed data
- Rotate credentials or keys that resided in paths reachable through symlinks from previously shared directories
Patch Information
The fix is available in OnionShare release v2.6.4. Details of the change are published in GitHub Security Advisory GHSA-22p9-r2f5-22mf and implemented in commit 48f31cf. The patch updates send_base_mode.py so symbolic links inside the selected directory are no longer followed.
Workarounds
- Copy files to be shared into a fresh directory that contains no symbolic links before starting OnionShare
- Run OnionShare inside a sandbox or container where read access is restricted to the shared files only
- Use a dedicated low-privilege user account for OnionShare to limit the scope of readable files
- Avoid using Share or Website mode with directories that were not manually curated
# Verify installed OnionShare version and remove symlinks from a share directory
onionshare-cli --version
find /path/to/share -type l -print -delete
# Then launch OnionShare against the sanitized directory
onionshare-cli --receive=false /path/to/share
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

