Skip to content

Path traversal in Onionshare

Moderate severity GitHub Reviewed Published Jan 18, 2022 in onionshare/onionshare • Updated Jan 29, 2023

Package

pip onionshare-cli (pip)

Affected versions

>= 2.3, < 2.5

Patched versions

2.5

Description

Between September 26, 2021 and October 8, 2021, Radically Open Security conducted a penetration test of OnionShare 2.4, funded by the Open Technology Fund's Red Team lab. This is an issue from that penetration test.

  • Vulnerability ID: OTF-013
  • Vulnerability type: Improper Hardening
  • Threat level: Low

Description:

The filesystem restriction could be hardened and should only allow for pre-defined subfolders.

Technical description:

The Flatpak and Snap configurations allow for read-only access on the whole home folder. The relevant lines in the configuration files are onionshare/snap/snapcraft.yaml#L20 and onionshare/flatpak/org.onionshare.OnionShare.yaml#L19 , respectively.

The encapsulation of filesystem access via these mechanisms should be restricted to pre-defined folders and not allow for access to (configuration) files outside the Onionshare-specific folders.

Sadly Snap does not allow for further restriction to specific folders and therefore cannot be further hardened. By default both frameworks disallow access to hidden folders and therefore reduce the potential impact.

Impact:

An adversary with a primitive that allows for filesystem access from the context of the Onionshare process can access sensitive files in the entire user home folder. This could lead to the leaking of sensitive data. Due to the automatic exclusion of hidden folders, the impact is reduced.

Recommendation:

  • Reduce read access in Flatpak configuration.

References

@micahflee micahflee published to onionshare/onionshare Jan 18, 2022
Published by the National Vulnerability Database Jan 18, 2022
Reviewed Jan 19, 2022
Published to the GitHub Advisory Database Jan 21, 2022
Last updated Jan 29, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N

EPSS score

0.071%
(32nd percentile)

Weaknesses

CVE ID

CVE-2022-21693

GHSA ID

GHSA-jgm9-xpfj-4fq6

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.