The maintainers of FreePBX, a widely deployed open-source VoIP PBX platform, have released patches for multiple security vulnerabilities, including one critical flaw that could lead to complete system takeover. The most severe issue, CVE-2025-66039, is a 9.3 CVSS authentication bypass that allows an unauthenticated attacker to gain administrative access in certain configurations. This can be chained with other patched vulnerabilities, including authenticated SQL injection (CVE-2025-61675) and arbitrary file upload (CVE-2025-61678), to achieve remote code execution (RCE). Given FreePBX's role in enterprise communication, these vulnerabilities pose a significant threat, and administrators should apply the updates immediately.
Researchers at Horizon3.ai discovered a series of flaws that could be combined to compromise a FreePBX server.
CVE-2025-66039 (CVSS 9.3, Critical): Authentication Bypass
This flaw exists when the 'Authorization Type' (AUTHTYPE) is set to webserver, which is not the default setting. In this configuration, FreePBX improperly trusts the Authorization HTTP header. An attacker can forge this header to impersonate an administrator and bypass the login for the Administrator Control Panel.
CVE-2025-61675 (CVSS 8.6, High): Authenticated SQL Injection Multiple endpoints within the FreePBX administrative interface are vulnerable to SQL injection. An attacker with a valid session (which could be obtained via CVE-2025-66039) can inject malicious SQL queries to read or write to the database, including adding a new administrative user.
CVE-2025-61678 (CVSS 8.6, High): Authenticated Arbitrary File Upload This vulnerability allows an authenticated administrator to upload arbitrary files to the server. An attacker could exploit this to upload a PHP web shell, granting them a persistent backdoor and the ability to execute commands on the underlying server.
An attacker could chain these vulnerabilities for a full system compromise:
T1190 - Exploit Public-Facing Application: Exploiting CVE-2025-66039 for initial access.T1133 - External Remote Services: Gaining access via the web-based admin panel.T1505.003 - Web Shell: Uploading a PHP shell for persistence and execution.T1059 - Command and Scripting Interpreter: Using the web shell to execute commands on the server.The vulnerabilities have been patched in the following FreePBX versions:
Administrators running versions prior to these are vulnerable.
A compromised FreePBX server poses a severe risk to an organization. Attackers can eavesdrop on phone calls, commit toll fraud by making unauthorized international calls at the victim's expense, pivot to the internal data network, and use the server as a launchpad for further attacks. The RCE capability gives the attacker full control over the server, allowing for the installation of ransomware, crypto miners, or other malware. The reputational damage from having sensitive business communications compromised is also significant.
| Type | Value | Description |
|---|---|---|
configuration_setting |
AUTHTYPE = webserver |
This non-default setting is a prerequisite for the critical auth bypass. Systems with this configuration are at high risk. |
log_source |
Apache/HTTPd Access Logs |
Look for requests to admin panel endpoints from unknown IPs, especially if they result in a 200 OK status without a preceding failed login attempt. |
file_path |
/var/www/html/ |
Monitor this directory and its subdirectories for the creation of new or suspicious .php files, which could indicate a web shell upload. |
process_name |
httpd, apache2 |
Monitor the web server process for suspicious child processes, such as sh, bash, curl, or wget, which could be executed by a web shell. |
AUTHTYPE is set to webserver. This can be done by checking the freepbx.conf file. This is a direct application of D3FEND System Configuration Permissions (D3-SCP).AUTHTYPE is set to its default value (database or usermanager), not webserver, unless there is a compelling and fully understood reason. The developers have now removed the option to change this from the GUI to discourage insecure configurations.Updating FreePBX to a patched version is the most effective remediation.
Restricting access to the admin panel to trusted IPs significantly reduces the attack surface.
Ensuring the authentication type is set to the secure default is a critical configuration hardening step.
The most critical action for all FreePBX administrators is to apply the latest security updates. The vulnerabilities, especially the authentication bypass (CVE-2025-66039), provide a direct path for attackers to gain control of the system. Organizations should use their patch management processes to roll out the updates for all FreePBX modules and system components to the specified patched versions (e.g., 16.0.92, 17.0.6, etc.). Because FreePBX is often a critical communication system, these updates should be tested in a staging environment if possible, but deployed to production with high urgency. Verifying the patch by checking the version numbers in the admin GUI is a crucial final step.
As a fundamental security best practice, the FreePBX administrative web interface should never be exposed directly to the public internet. This single measure would have mitigated the risk of unauthenticated remote exploitation of CVE-2025-66039. Implement Network Isolation by placing the FreePBX server in a secure management zone. Use firewall rules to restrict access to the web admin portal (typically on TCP ports 80 and 443) to only a limited set of internal IP addresses, such as a dedicated administrative LAN or specific jump hosts. For remote administration, require users to connect to a VPN first before they can access the admin portal. This drastically reduces the attack surface and protects against scanners and opportunistic attackers looking for vulnerable instances.
To detect a successful compromise via the arbitrary file upload vulnerability (CVE-2025-61678), organizations should implement System File Analysis, commonly through a File Integrity Monitoring (FIM) solution. A FIM agent should be deployed on the FreePBX server to monitor critical directories, most importantly the web root (/var/www/html/ and its subdirectories). Configure the FIM to create a baseline of known good files and then alert on any unauthorized changes, creations, or deletions. Specifically, create a high-severity alert for the creation of any new .php files in these directories, as this is the most common indicator of a web shell being uploaded. Upon receiving such an alert, security teams should immediately invoke their incident response plan to isolate the server and analyze the suspicious file.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats