The vulnerability is a path traversal sanitization bypass in multiple API endpoints of FUXA. The root cause was the use of a simple, single-pass string replacement (.replace('../', '')) to sanitize user-provided file paths. This method is insufficient and can be bypassed using nested traversal sequences like ....//. An attacker could exploit this flaw in endpoints responsible for file uploads, downloads, and deletions (/api/upload, /api/command, /api/logs, /api/resources/remove, /api/reports/remove).
The successful exploitation of the file upload endpoint (/api/upload) has the highest impact, as it allows an attacker to write a malicious script file to a sensitive directory (e.g., runtime/scripts). When the server reloads these scripts, it results in Remote Code Execution (RCE), giving the attacker full control over the system. Other affected endpoints allow for arbitrary file reading and deletion, leading to information disclosure and denial of service.
The patch addresses this by introducing a robust path sanitization utility (path-helper.js) that normalizes and resolves paths within a designated base directory, effectively preventing any traversal outside of it. The vulnerable functions were identified by locating where the inadequate string replacement was replaced by calls to this new, secure utility.