CVE-2022-21693: Onionshare cli Path Traversal Vulnerability
MODERATECVE-2022-21693 is a MODERATE (CVSS 6.3) path traversal vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Onionshare cli libraries in the PyPI ecosystem. The issue involves path traversal in onionshare. Remediation is available by upgrading affected packages to version 2.5.
CVE-2022-21693 at a Glance
Security Impact
CVSS: 6.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N).
How to Fix CVE-2022-21693
To remediate this vulnerability, upgrade all affected Onionshare cli dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install onionshare-cli>=2.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show onionshare-cli
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-21693, inspect your installed packages using pip:
pip show onionshare-cli
Analyze the terminal output to locate any version of Onionshare cli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.5), your application is affected.
Note: The pip show onionshare-cli command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Onionshare cli, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-21693 Affected Onionshare cli Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
onionshare-cli
|
PyPI |
≥ 2.3
< 2.5
|
2.5
|
References
Frequently Asked Questions
What is CVE-2022-21693?
Which Onionshare cli versions are affected?
What version fixes CVE-2022-21693?
Is onionshare-cli affected?
What is the CVSS score of CVE-2022-21693?
What CWE is associated with CVE-2022-21693?
How can I check PyPI dependencies for CVE-2022-21693?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jgm9-xpfj-4fq6",
"modified" : "2024-10-07T21:02:51Z",
"published" : "2022-01-21T23:20:19Z",
"aliases" : [ "CVE-2022-21693" ],
"summary" : "Path traversal in Onionshare",
"details" : "Between September 26, 2021 and October 8, 2021, [Radically Open Security](https://www.radicallyopensecurity.com/) conducted a penetration test of OnionShare 2.4, funded by the Open Technology Fund's [Red Team lab](https://www.opentech.fund/labs/red-team-lab/). This is an issue from that penetration test.\n\n- Vulnerability ID: OTF-013\n- Vulnerability type: Improper Hardening\n- Threat level: Low\n\n## Description:\n\nThe filesystem restriction could be hardened and should only allow for pre-defined subfolders.\n\n## Technical description:\n\nThe 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.\n\nThe 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.\n\nSadly 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.\n\n## Impact:\n\nAn 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.\n\n## Recommendation:\n\n- Reduce read access in Flatpak configuration.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "onionshare-cli"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.3"
}, {
"fixed" : "2.5"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/onionshare/onionshare/security/advisories/GHSA-jgm9-xpfj-4fq6"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21693"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/onionshare/onionshare"
}, {
"type" : "WEB",
"url" : "https://github.com/onionshare/onionshare/releases/tag/v2.5"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/onionshare-cli/PYSEC-2022-44.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-22" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-19T19:28:05Z",
"nvd_published_at" : "2022-01-18T22:15:00Z"
}
}