This module exploits an authenticated command injection vulnerability (CVE-2025-64328) in the FreePBX filestore module. The filestore module allows administrators to configure remote file storage backends (SSH, FTP, etc.) for backup and file management purposes. The vulnerability exists in the SSH driver's testconnection functionality, specifically in the check_ssh_connect() function located at /admin/modules/filestore/drivers/SSH/testconnection.php. The function accepts user-controlled input for the SSH key path parameter, which is then passed unsanitized to exec() calls when generating SSH keys. The vulnerable code executes commands such as: exec("ssh-keygen -t ecdsa -b 521 -f $key -N \"\" && chown asterisk:asterisk $key && chmod 600 $key"); By injecting shell command substitution syntax (e.g., $(command)) into the key parameter, an authenticated user can execute arbitrary commands on the underlying system with the privileges of the web server process (typically the asterisk user). This vulnerability affects filestore module versions 17.0.2.36 through 17.0.2.44 (introduced in 17.0.2.36, patched in 17.0.3). The module requires valid FreePBX credentials for a user account that has access to the filestore module. The user must be in the "Filestore" group (administrator or low-privilege user). Note: Due to the vulnerable code structure, the injected command may be executed multiple times, potentially resulting in multiple Meterpreter sessions.
Exploit database
Vulnerability
CVE-2025-64328
FreePBX Administration GUI is Vulnerable to Authenticated Command Injection
Vulnerability details
- Score
- 8.6
- Severity
- high
CVSS 4.0 · GitHub_M
Vector string
CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:NDescription
FreePBX Endpoint Manager is a module for managing telephony endpoints in FreePBX systems. In versions 17.0.2.36 and above before 17.0.3, the filestore module within the Administrative interface is vulnerable to a post-authentication command injection by an authenticated known user via the testconnection -> check_ssh_connect() function. An attacker can leverage this vulnerability to obtain remote access to the system as an asterisk user. This issue is fixed in version 17.0.3.
CVE ProgramExploit source choices
1 sourceFreePBX filestore authenticated command injection
2025-11-08freepbx_filestore_cmd_injection.rb