A command injection vulnerability exists in the `TranscriptEndpoint` of mudler/localai, specifically within the `audioToWav` function used for converting audio files to WAV format for transcription. The vulnerability arises due to the lack of sanitization of user-supplied filenames before passing them to ffmpeg via a shell command, allowing an attacker to execute arbitrary commands on the host system. Successful exploitation could lead to unauthorized access, data breaches, or other detrimental impacts, depending on the privileges of the process executing the code.
The `audioToWav` function responsible for converting audio files to WAV format passes the filename provided by the user directly to the shell command invoking ffmpeg, without any validation or sanitization. An attacker can craft a malicious filename containing additional system commands (e.g., using shell special characters), which will be executed in the context of the server process. No authentication or user interaction is required.
Successful exploitation of the vulnerability allows an attacker to execute arbitrary commands on the server hosting LocalAI, which may lead to unauthorized data access, disclosure of sensitive information, system takeover, or other damage depending on process privileges.
mudler/LocalAI should be updated to a version containing commit 31a4c9c9d3abc58de2bdc5305419181c8b33eb1c, which introduces proper sanitization of filenames passed to ffmpeg. Details are available in the vendor references on GitHub and in the report on the huntr.com platform.
Product mudler/LocalAI — versions indicated in vendor references (patched commit: 31a4c9c9d3abc58de2bdc5305419181c8b33eb1c)
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HMudler Localai
APPMudler< 2.10.0
Related vulnerabilities
Podatność tarslip w LocalAI umożliwiająca RCE przez arbitralny zapis pliku
Command injection w LocalAI — pełne przejęcie systemu przez parametr backend
Path traversal w LocalAI umożliwiający usuwanie dowolnych plików
mudler/localai version 2.17.1 is vulnerable to remote code execution. The vulnerability arises because the loc...
mudler/localai version v2.21.1 contains a Cross-Site Scripting (XSS) vulnerability in its search functionality...