Skip to content

Improper Access Control in Onionshare

Moderate severity GitHub Reviewed Published Jan 18, 2022 in onionshare/onionshare • Updated Jan 29, 2023

Package

pip onionshare-cli (pip)

Affected versions

>= 2.3, < 2.5

Patched versions

2.5

Description

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-004
  • Vulnerability type: Improper Access Control
  • Threat level: Moderate

Description:

Chat participants can spoof their channel leave message, tricking others into assuming they left the chatroom.

Technical description:

otf-004-a
otf-004-b
otf-004-c

This series of screenshots show Alice, Bob and Eve joined a chatroom and are the only participants in the chatroom. Eve seemingly leaves the chatroom, which leads Bob and Alice to believe they are having a private chat. The last screenshot shows that Eve only emitted the leave message and is still able to read the chat and possibly write messages.

This can be reproduced by joining the chat with two different instances, where one instance has slightly modified the client-side JavaScript code similar to OTF-003 (page 22). The joined emit needs to be removed from the connect event handler. Therefore the modified client is not listed in the userlist and has no active session. The modified non-listed user also needs to change their username to Eve, which is not shown in the chatroom. The modified client then emits the disconnect event and their connection is no longer usable.

This results in the leave message for Eve and the removal from the user-list but not in removal of the original session of the Eve who announced to join the chat.

Impact:

An adversary with access to the chat environment can spoof his leave event but still persist in the chat with access to all sent messages and the possibility to write in the chat using OTF-003 (page 22).

Recommendation:

  • Implement proper session handling

References

@micahflee micahflee published to onionshare/onionshare Jan 18, 2022
Published by the National Vulnerability Database Jan 18, 2022
Reviewed Jan 19, 2022
Published to the GitHub Advisory Database Jan 21, 2022
Last updated Jan 29, 2023

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

EPSS score

0.050%
(20th percentile)

Weaknesses

CVE ID

CVE-2022-21691

GHSA ID

GHSA-w9m4-7w72-r766

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.