Skip to main content

CVE-2022-24900: CWE-73: External Control of File Name or Path in onlaj Piano-LED-Visualizer

Medium
Published: Fri Apr 29 2022 (04/29/2022, 13:50:11 UTC)
Source: CVE
Vendor/Project: onlaj
Product: Piano-LED-Visualizer

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.

AI-Powered Analysis

AILast updated: 06/22/2025, 02:04:49 UTC

Technical Analysis

CVE-2022-24900 is a path traversal vulnerability affecting versions 1.3 and earlier of the Piano-LED-Visualizer software developed by onlaj. This software integrates with a piano connected to a computer to visually represent piano key presses via LED lights. The vulnerability arises from unsafe handling of file paths within the application, specifically in the use of Python's os.path.join function combined with Flask's send_file method. The os.path.join function, when given an absolute path as an argument, disregards preceding path components and uses the absolute path directly. In this case, untrusted user input is passed as an absolute path parameter to os.path.join, which then leads to the Flask send_file function serving files outside the intended directory. This improper limitation of pathname (CWE-22) and external control of file name or path (CWE-73) can allow an attacker to access arbitrary files on the host system by crafting malicious requests that exploit this path traversal. The vulnerability can be mitigated by sanitizing input paths, using Flask's safe_join function to safely join untrusted paths, or replacing send_file calls with send_from_directory to restrict file serving to a specific directory. A patch addressing this issue is available on the master branch of the project's GitHub repository. No known exploits have been reported in the wild to date.

Potential Impact

For European organizations using Piano-LED-Visualizer, particularly in educational institutions, music studios, or entertainment venues, this vulnerability could lead to unauthorized disclosure of sensitive files on the host system. Attackers exploiting this flaw could read configuration files, credentials, or other sensitive data stored on the system, potentially facilitating further attacks or data breaches. Although the software's niche use limits the attack surface, compromised systems could be leveraged as footholds within larger networks. The impact on confidentiality is significant, while integrity and availability impacts are lower unless the attacker uses the access to modify files or disrupt services. Given the lack of authentication requirements and the ease of exploitation via crafted requests, the threat poses a moderate risk. However, the absence of known exploits and the specialized nature of the software reduce the likelihood of widespread impact.

Mitigation Recommendations

European organizations should prioritize updating Piano-LED-Visualizer to the latest version from the master branch where the patch is applied. If immediate updates are not feasible, developers or administrators should modify the application code to replace os.path.join calls with Flask's safe_join function when handling untrusted input paths. Alternatively, replacing send_file calls with send_from_directory ensures files are served only from designated directories, preventing path traversal. Network-level controls such as restricting access to the application via firewalls or VPNs can reduce exposure. Additionally, monitoring logs for unusual file access patterns or requests containing absolute paths can help detect exploitation attempts. Organizations should also conduct code reviews and penetration testing focused on file path handling in custom or third-party applications to proactively identify similar vulnerabilities.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
GitHub_M
Date Reserved
2022-02-10T00:00:00.000Z
Cisa Enriched
true

Threat ID: 682d9848c4522896dcbf646d

Added to database: 5/21/2025, 9:09:28 AM

Last enriched: 6/22/2025, 2:04:49 AM

Last updated: 8/16/2025, 10:19:05 AM

Views: 20

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats