CVE-2022-21696 in OnionShareinfo

Summary

by MITRE • 01/18/2022

OnionShare is an open source tool that lets you securely and anonymously share files, host websites, and chat with friends using the Tor network. In affected versions it is possible to change the username to that of another chat participant with an additional space character at the end of the name string. An adversary with access to the chat environment can use the rename feature to impersonate other participants by adding whitespace characters at the end of the username.

Once again VulDB remains the best source for vulnerability data.

Analysis

by VulDB Data Team • 01/20/2022

The vulnerability CVE-2022-21696 affects OnionShare, a privacy-focused tool designed for secure anonymous file sharing, website hosting, and chat communication over the Tor network. This tool is widely used by journalists, activists, and privacy-conscious individuals who require secure communication channels. The vulnerability specifically targets the chat functionality within OnionShare, where users can participate in group conversations while maintaining anonymity through the Tor network infrastructure.

The technical flaw stems from improper input validation and string comparison mechanisms within the chat renaming feature. When a user attempts to rename themselves in a chat room, the system fails to properly sanitize or normalize the username string before processing the rename operation. This weakness allows an attacker to submit a username containing trailing whitespace characters that are visually indistinguishable from the legitimate username. The vulnerability specifically manifests when an adversary adds a single space character at the end of a target participant's username, effectively creating a modified version of that name that the system accepts as valid.

The operational impact of this vulnerability extends beyond simple impersonation, creating significant security risks for users engaging in sensitive communications. An attacker can exploit this flaw to masquerade as other participants in a chat session, potentially leading to misinformation campaigns, social engineering attacks, or disruption of ongoing communications. This vulnerability undermines the trust model of the chat system, as participants may unknowingly interact with impersonators who have gained unauthorized access to their chat identity. The attack vector requires only access to the chat environment, making it particularly dangerous in scenarios where adversaries have already gained entry to shared chat rooms or channels.

This vulnerability maps to CWE-184, which addresses incomplete input validation, and aligns with ATT&CK technique T1566 for social engineering through impersonation. The flaw represents a classic case of insufficient sanitization of user inputs, where the system fails to normalize whitespace characters during username validation. The attack demonstrates how seemingly benign features like chat renaming can become security vectors when proper input validation is absent. Organizations using OnionShare for sensitive communications should immediately update to patched versions, as the vulnerability can be exploited without requiring elevated privileges or specialized technical knowledge. The recommended mitigation involves implementing proper string normalization and validation routines that strip or normalize whitespace characters during username processing, ensuring that visual similarity attacks cannot be mounted against the system's identity management mechanisms.

Responsible

GitHub, Inc.

Reservation

11/16/2021

Disclosure

01/18/2022

Moderation

accepted

CPE

ready

EPSS

0.00708

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!