CVE-2022-21690

8.7 HIGH

📋 TL;DR

CVE-2022-21690 is a cross-site scripting (XSS) vulnerability in OnionShare where the path parameter is not properly sanitized before being passed to the QT frontend. This allows attackers to inject malicious scripts that execute in the OnionShare interface when users view server access history. All users running affected versions of OnionShare are vulnerable.

💻 Affected Systems

Products:
  • OnionShare
Versions: Versions before 2.5
Operating Systems: All platforms running OnionShare
Default Config Vulnerable: ⚠️ Yes
Notes: All OnionShare components that display server access history are affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could execute arbitrary JavaScript in the OnionShare interface, potentially stealing session data, manipulating the interface, or performing actions on behalf of the user.

🟠

Likely Case

Attackers inject malicious scripts that execute when users view access history, potentially stealing sensitive information or performing unauthorized actions.

🟢

If Mitigated

With proper input sanitization and output encoding, the injected scripts would be rendered harmless as text rather than executable code.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

XSS vulnerabilities are commonly exploited and weaponization is likely given the public advisory details.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.5

Vendor Advisory: https://github.com/onionshare/onionshare/security/advisories/GHSA-ch22-x2v3-v6vq

Restart Required: Yes

Instructions:

1. Download OnionShare v2.5 or later from the official repository. 2. Stop any running OnionShare instances. 3. Install the updated version. 4. Restart OnionShare services.

🔧 Temporary Workarounds

Disable access history display

all

Temporarily disable the server access history feature to prevent exploitation.

Modify OnionShare configuration to disable history logging and display

🧯 If You Can't Patch

  • Restrict access to OnionShare instances to trusted users only
  • Implement network segmentation to isolate OnionShare instances from critical systems

🔍 How to Verify

Check if Vulnerable:

Check OnionShare version - if it's below 2.5, it's vulnerable.

Check Version:

onionshare --version

Verify Fix Applied:

Verify OnionShare version is 2.5 or higher and test that path parameters are properly sanitized.

📡 Detection & Monitoring

Log Indicators:

  • Unusual path parameters containing script tags or JavaScript in access logs

Network Indicators:

  • HTTP requests with malicious script payloads in URL paths

SIEM Query:

source="onionshare" AND (url="*<script>*" OR url="*javascript:*")

🔗 References

📤 Share & Export