9.9critical
Absolute Path Traversal due to incorrect use of `send_file` call in Piano LED Visualizer
- Severity
- 9.9critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 8.41% (higher than 95% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
Description
Piano LED Visualizer is software that allows LED lights to light up as a person plays a piano connected to a computer. Version 1.3 and prior are vulnerable to a path traversal attack. The `os.path.join` call is unsafe for use with untrusted input. When the `os.path.join` call encounters an absolute path, it ignores all the parameters it has encountered till that point and starts working with the new absolute path. Since the "malicious" parameter represents an absolute path, the result of `os.path.join` ignores the static directory completely. Hence, untrusted input is passed via the `os.path.join` call to `flask.send_file` can lead to path traversal attacks. A patch with a fix is available on the `master` branch of the GitHub repository. This can also be fixed by preventing flow of untrusted data to the vulnerable `send_file` function. In case the application logic necessiates this behaviour, one can either use the `flask.safe_join` to join untrusted paths or replace `flask.send_file` calls with `flask.send_from_directory` calls.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| onlaj Piano-LED-Visualizer | <= 1.3 | CVE List |
| piano_led_visualizer_project piano_led_visualizer | up to 1.3 | NVD |
All scores
| GitHub_M | 9.9critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L |
| NVD | 8.6high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:N/A:N |
Classification
What each source says
CVE List
Piano LED Visualizer is software that allows LED lights to light up as a person plays a piano connected to a computer. Version 1.3 and prior are vulnerable to a path traversal attack. The `os.path.join` call is unsafe for use with untrusted input. When the `os.path.join` call encounters an absolute path, it ignores all the parameters it has encountered till that point and starts working with the new absolute path. Since the "malicious" parameter represents an absolute path, the result of `os.path.join` ignores the static directory completely. Hence, untrusted input is passed via the `os.path.join` call to `flask.send_file` can lead to path traversal attacks. A patch with a fix is available on the `master` branch of the GitHub repository. This can also be fixed by preventing flow of untrusted data to the vulnerable `send_file` function. In case the application logic necessiates this behaviour, one can either use the `flask.safe_join` to join untrusted paths or replace `flask.send_file` calls with `flask.send_from_directory` calls.
NVD (es)
Piano LED Visualizer es un software que permite que las luces LED sean iluminadas mientras una persona toca un piano conectado a un ordenador. La versión 1.3 y anteriores son vulnerables a un ataque de salto de ruta. La llamada "os.path.join" no es segura para su uso con entradas no confiables. Cuando la llamada "os.path.join" encuentra una ruta absoluta, ignora todos los parámetros que ha encontrado hasta ese momento y comienza a trabajar con la nueva ruta absoluta. Dado que el parámetro "malicioso" representa una ruta absoluta, el resultado de "os.path.join" ignora completamente el directorio estático. Por lo tanto, la entrada no confiable que se pasa por medio de la llamada de "os.path.join" a "flask.send_file" puede conllevar a ataques de salto de ruta. Un parche con una corrección está disponible en la rama "master" del repositorio GitHub. Esto también puede corregirse al impedir el flujo de datos no confiables a la función vulnerable "send_file". En caso de que la lógica de la aplicación necesite este comportamiento, puede usarse "flask.safe_join" para unir rutas no confiables o sustituir las llamadas a "flask.send_file" por llamadas a "flask.send_from_directory"
References
| https://github.com/onlaj/Piano-LED-Visualizer/security/advisories/GHSA-g78x-q3x8-r6m4 | exploit, patch, third-party-advisory | |
| https://github.com/onlaj/Piano-LED-Visualizer/issues/350 | exploit, issue-tracking, patch, third-party-advisory | |
| https://github.com/onlaj/Piano-LED-Visualizer/pull/351 | exploit, issue-tracking, patch, third-party-advisory | |
| https://github.com/onlaj/Piano-LED-Visualizer/commit/3f10602323cd8184e1c69a76b815655597bf0ee5 | patch, third-party-advisory | |
| https://github.com/onlaj/Piano-LED-Visualizer/blob/6a732caa812c83a807c711f3d091af99209cae7b/webinterface/views_api.py#L970 | exploit, third-party-advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2022-24900 changed 2025-04-22 | CVE Terms of Use |
| NVD | CVE-2022-24900 changed 2026-06-17 | Public domain |