CVE-2022-21690: onionshare-cli Improper Input Sanitation

onionshare-cli Updated 02 Oct 2025

Summary

21/01/2022
Yes i
Moderate
8.7

CVE-2022-21690: 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. Affects onionshare-cli versions < 2.5. Fixed in 2.5. How to fix ↓

Also tracked for

The same CVE-2022-21690 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The onionshare-cli package is a Python package available on PyPI. It is a command-line interface for OnionShare, a tool that allows users to securely and anonymously share files over the Tor network. OnionShare provides a way to create an Onion service and share its address with others. The onionshare-cli package is used to interact with OnionShare from the command line. It is vulnerable to an improper input sanitation issue that can lead to the rendering of arbitrary HTML in the server desktop application.

Vulnerability Detail

The vulnerability (OTF-001) in onionshare-cli arises from the lack of input sanitization in the path parameter of the requested URL. This parameter is not properly sanitized before being passed to the constructor of the QLabel class in the QT frontend. As a result, an attacker with knowledge of the Onion service address can inject crafted HTML code, which will be rendered as a subset of HTML 4 markup (QT RichText editor) in the Onionshare frontend. This could potentially lead to remote code execution if there are 0-day vulnerabilities in the image rendering components of the QT framework. The impact of this vulnerability is elevated, as it requires the desktop application with rendered history.

How To Fix

Latest published version: 2.7.0 as of 22 Oct 2026

pip install --upgrade "onionshare-cli==2.7.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.5

This is the first release that contains the fix.

pip install --upgrade "onionshare-cli==2.5"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

A possible workaround for this vulnerability is to manually define the text format of the QLabel via the setTextFormat() method. By explicitly setting the text format to plain text, any injected HTML code will be treated as plain text and not rendered as HTML. Here is an example of how to implement this workaround:

# Manually define the text format
label.setTextFormat(Qt.PlainText)

Conclusion

In conclusion, the onionshare-cli package is vulnerable to an improper input sanitation issue that allows for the injection of arbitrary HTML code in the server desktop application. To mitigate this vulnerability, it is recommended to update to version 2.5 of onionshare-cli, properly sanitize the path parameter, and set the text format to plain text. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for onionshare-cli →

Share this vulnerability

FAQ

onionshare-cli is a Python package that provides a command-line interface for OnionShare, a tool for securely sharing files over the Tor network.

The impact of this vulnerability is elevated, as it allows an attacker to inject arbitrary HTML code in the server desktop application. However, remote code execution is only possible if there are 0-day vulnerabilities in the image rendering components of the QT framework.

To fix this vulnerability, you should update onionshare-cli to version 2.5. Additionally, ensure that the path parameter is properly sanitized and that the setTextFormat() method is called to set the text format to plain text.

Yes, a possible workaround is to manually define the text format of the QLabel via the setTextFormat() method. By setting the text format to plain text, any injected HTML code will be treated as plain text and not rendered as HTML.

You can find more information about OnionShare on the official website: https://onionshare.org

Related vulnerabilities

Recent vulnerabilities recorded for onionshare-cli.

How To Fix

Latest published version: 2.7.0 as of 22 Oct 2026

pip install --upgrade "onionshare-cli==2.7.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.5

This is the first release that contains the fix.

pip install --upgrade "onionshare-cli==2.5"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback