3.7low
OTF-006: Broken Website Hardening Control: The CSP can be turned on or off but not configured for the specific needs of the website
- Severity
- 3.7low CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.30% (higher than 71% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-h29c-wcm8-883hPYSEC-2022-45
Description
OnionShare is an open source tool that lets you securely and anonymously share files, host websites, and chat with friends using the Tor network. The website mode of the onionshare allows to use a hardened CSP, which will block any scripts and external resources. It is not possible to configure this CSP for individual pages and therefore the security enhancement cannot be used for websites using javascript or external resources like fonts or images.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| onionshare onionshare | < 2.5, before 2.5 | CVE List, NVD |
| onionshare-cli (PyPI) | from 2.2 before 2.5, before 2.5 | GitHub Advisory Database, PyPA Advisory Database |
All scores
| GitHub_M | 3.7low CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | 3.7medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N |
| NVD | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:P/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
OnionShare is an open source tool that lets you securely and anonymously share files, host websites, and chat with friends using the Tor network. The website mode of the onionshare allows to use a hardened CSP, which will block any scripts and external resources. It is not possible to configure this CSP for individual pages and therefore the security enhancement cannot be used for websites using javascript or external resources like fonts or images.
GitHub Advisory Database
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-006
- Vulnerability type: Broken Website Hardening Control
- Threat level: Low
Description:
The CSP can be turned on or off but not configured for the specific needs of the website.
Technical description:
The website mode of the application allows to use a hardened CSP, which will block any scripts and external resources. It is not possible to configure this CSP for individual pages and therefore the security enhancement cannot be used for websites using javascript or external resources like fonts or images.
If CSP were configurable, the website creator could harden it accordingly to the needs of the application.
As this issue correlates with the Github issue for exposing the flask application directly (https://github.com/onionshare/ onionshare/issues/1389), it can be assumed that this can be solved by either changing to a well-known webserver, which supports this kind of configuration, or enhancing the status quo by making the CSP a configurable part of each website.
We believe that bundling the nginx or apache webserver would add complexity and dependencies to the application that could result in a larger attack surface - as these packages receive regular security updates. On the other hand it is not recommended to directly expose the flask webserver, due to lack of hardening. This is a trade-off which needs to be evaluated by the Onionshare developers, as multiple features are involved. Ideally the application user could choose between the built-in flask webserver or a system webserver of choice.
Impact:
As this is a general weakness and not a direct vulnerability in the Onionshare application, the direct impact of this issue is rather low.
Recommendation:
- Consider offering a configurable webserver choice
- Consider configurable CSP
NVD (es)
OnionShare es una herramienta de código abierto que permite compartir archivos, alojar sitios web y chatear con amigos de forma segura y anónima usando la red Tor. El modo sitio web de onionshare permite usar un CSP endurecido, que bloqueará cualquier script y recurso externo. No es posible configurar este CSP para páginas individuales y, por lo tanto, la mejora de seguridad no puede ser usada para sitios web que usen javascript o recursos externos como fuentes o imágenes
References
| https://github.com/onionshare/onionshare/releases/tag/v2.5 | release-notes, third-party-advisory, web | |
| https://github.com/onionshare/onionshare/security/advisories/GHSA-h29c-wcm8-883h | advisory, third-party-advisory, web | |
| https://github.com/onionshare/onionshare/issues/1389 | issue-tracking, report, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2022-21694 | advisory | |
| https://github.com/onionshare/onionshare | package | |
| https://github.com/pypa/advisory-database/tree/main/vulns/onionshare-cli/PYSEC-2022-45.yaml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-21694 changed 2025-04-23 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-h29c-wcm8-883h changed 2024-10-07 | CC-BY-4.0 |
| NVD | CVE-2022-21694 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2022-45 changed 2023-11-08 | CC-BY-4.0 |