Media

OTF-001: Improper Input Sanitation: The path parameter of the requested URL is not sanitized before being passed to the QT frontend

  • Publicada: 18.01.2022
  • Actualizado: 11.10.2026 11:20

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-001
  • Vulnerability type: Improper Input Sanitization
  • Threat level: Elevated

Description:

The path parameter of the requested URL is not sanitized before being passed to the QT frontend.

Technical description:

The path parameter is not sanitized before being passed to the constructor of the QLabel.

https://github.com/onionshare/onionshare/blob/d08d5f0f32f755f504494d80794886f346fbafdb/desktop/src/onionshare/tab/mode/__init__.py#L499-L509

https://github.com/onionshare/onionshare/blob/d08d5f0f32f755f504494d80794886f346fbafdb/desktop/src/onionshare/tab/mode/history.py#L456-L483

https://doc.qt.io/qt-5/qlabel.html#details

Warning: When passing a QString to the constructor or calling setText(), make sure to sanitize your input, as QLabel tries to guess whether it displays the text as plain text or as rich text, a subset of HTML 4 markup. You may want to call setTextFormat() explicitly, e.g. in case you expect the text to be in plain format but cannot control the text source (for instance when displaying data loaded from the Web).

This path is used in all components for displaying the server access history. This leads to a rendered HTML4 Subset (QT RichText editor) in the Onionshare frontend.

In the following example an adversary injects a crafted image file into an Onionshare instance with receive mode and renders it in the history component of the Onionshare application.

The only requirement is another visit to the shared site with the following parameter attached to the path of the URL:

<img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAIAAAACUFjqAAAAFElEQVQY02Nk+M+ABzAxMIxKYwIAQC0BEwZFOw4AAAAASUVORK5CYII=' />

This will be rendered as a green square in the history tab where the path value is supposed to be (the value itself is shown at the bottom of the page).

otf-001

Possible scenarios where this could lead to remote code execution would be a 0-day in libpng or other internal image rendering (OTF-014 (page 12)) of the QT framework.

The QT documentation indicates that external files could be rendered, but we were unable to find a QT code path allowing for it.

Impact:

An adversary with knowledge of the Onion service address in public mode or with authentication in private mode can render arbitrary HTML (QT-HTML4 Subset) in the server desktop application. This requires the desktop application with rendered history, therefore the impact is only elevated.

Recommendation:

  • Manually define the text format of the QLabel via setTextFormat()

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Python (PyPI) onionshare-cli < 2.5 2.5

Referencias

Puntuación CVSS 8.7/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
Debilidad (CWE)
CWE-79
Plataforma
Python (PyPI)
Paquete
onionshare-cli
Publicada
18.01.2022
Actualizado
11.10.2026 11:20

Fuentes y licencias

OSV / GitHub Advisory Database - PYSEC-2022-41 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-ch22-x2v3-v6vq - CC BY 4.0

Historial de vulnerabilidades: onionshare-cli

Todas las vulnerabilidades publicadas de este paquete (Python (PyPI)), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (13) en el archivo
Entradas en total
13
Primera → última
11.2021 07.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Crítica 1
  • Alta 2
  • Media 10

Divulgaciones por año

  1. 2021: 2
  2. 2022: 9
  3. 2023: 0
  4. 2024: 0
  5. 2025: 0
  6. 2026: 2
Gravedad:
  1. OTF-001: Improper Input Sanitation: The path parameter of the requested URL is not sanitized before being passed to the QT frontend esta entrada
    Media · 8.7 CVE-2022-21690 < 2.5 2.5
  2. Alta · 7.5 CVE-2022-21689 < 2.5 2.5
  3. Alta · 7.5 CVE-2022-21688 < 2.5 2.5
  4. Crítica · 9.8 CVE-2021-41868 >= 2.3, < 2.4 2.4

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.