/

CVE-2026-54710

Severity:

HIGH RISK

(8.8)

PHP Code Injection (CWE-94) in FreePBX Superfecta Module

CVE-2026-54710

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-20, CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A high-severity vulnerability in the FreePBX Superfecta module allows authenticated attackers to cause arbitrary PHP files to be included and executed by the web application. Exploitation requires a valid username and supporting control over file or directory locations that influence the module's dynamic inclusion logic.

A high-severity vulnerability in the FreePBX Superfecta module allows authenticated attackers to cause arbitrary PHP files to be included and executed by the web application. Exploitation requires a valid username and supporting control over file or directory locations that influence the module's dynamic inclusion logic.

Affected context

The issue affects FreePBX deployments using vulnerable versions of the Superfecta module. It occurs in AJAX handling for the module's options and save-options operations, where user-influenced values determine PHP files loaded from the module's sources directory. Exploitation becomes more feasible when an attacker can also create directories or upload files through other available modules and obtain their filesystem paths.

The issue affects FreePBX deployments using vulnerable versions of the Superfecta module. It occurs in AJAX handling for the module's options and save-options operations, where user-influenced values determine PHP files loaded from the module's sources directory. Exploitation becomes more feasible when an attacker can also create directories or upload files through other available modules and obtain their filesystem paths.

Exploit preconditions

  • Attack surface: Authenticated FreePBX web application and Superfecta module AJAX handlers
  • Required access: A valid account associated with a known username, plus sufficient access to invoke the affected functionality
  • Trigger point: Processing of Superfecta options or save-options requests
  • Supporting conditions: The attacker may need a way to influence filesystem locations through directory creation or file upload functionality
  • Why exploitation is possible: User-controlled input is used to select PHP files for dynamic inclusion without adequately restricting the target path or treating the file as inert data
  • Attack surface: Authenticated FreePBX web application and Superfecta module AJAX handlers
  • Required access: A valid account associated with a known username, plus sufficient access to invoke the affected functionality
  • Trigger point: Processing of Superfecta options or save-options requests
  • Supporting conditions: The attacker may need a way to influence filesystem locations through directory creation or file upload functionality
  • Why exploitation is possible: User-controlled input is used to select PHP files for dynamic inclusion without adequately restricting the target path or treating the file as inert data

Why this happens

The underlying flaw is unsafe dynamic inclusion of PHP files based on user-supplied input. Rather than mapping input to a tightly controlled set of non-executable resources, the handler permits values to influence which PHP source is loaded, creating a code-injection condition. This maps primarily to CWE-94: Improper Control of Generation of Code, with CWE-20: Improper Input Validation describing the insufficient validation of the controlling values.

The underlying flaw is unsafe dynamic inclusion of PHP files based on user-supplied input. Rather than mapping input to a tightly controlled set of non-executable resources, the handler permits values to influence which PHP source is loaded, creating a code-injection condition. This maps primarily to CWE-94: Improper Control of Generation of Code, with CWE-20: Improper Input Validation describing the insufficient validation of the controlling values.

Potential impact

  • An authenticated attacker may execute arbitrary PHP code
  • The web server account could be compromised
  • Application data and configuration may be read or modified
  • The attacker could alter PBX behavior or communications
  • Compromise may support further movement into connected systems, depending on service privileges
  • An authenticated attacker may execute arbitrary PHP code
  • The web server account could be compromised
  • Application data and configuration may be read or modified
  • The attacker could alter PBX behavior or communications
  • Compromise may support further movement into connected systems, depending on service privileges

General mitigation guidance

Mitigation should focus on eliminating executable-file selection from user-controlled input and reducing trust in filesystem paths.

Common defensive patterns include:

  • Replacing dynamic PHP includes with an allowlisted mapping to fixed, reviewed handlers
  • Treating uploaded or generated files as data rather than executable server-side code
  • Canonicalizing and validating paths against approved directories
  • Separating upload, backup, and module-management permissions
  • Running the web service with the minimum filesystem and system privileges required
  • Restricting authenticated access to administrative AJAX operations and enforcing authorization checks
  • Applying vendor-maintained patched code through normal change-management processes

Mitigation should focus on eliminating executable-file selection from user-controlled input and reducing trust in filesystem paths.

Common defensive patterns include:

  • Replacing dynamic PHP includes with an allowlisted mapping to fixed, reviewed handlers
  • Treating uploaded or generated files as data rather than executable server-side code
  • Canonicalizing and validating paths against approved directories
  • Separating upload, backup, and module-management permissions
  • Running the web service with the minimum filesystem and system privileges required
  • Restricting authenticated access to administrative AJAX operations and enforcing authorization checks
  • Applying vendor-maintained patched code through normal change-management processes

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules identifying dynamic include, require, or equivalent operations using request-derived values
  • Code review checks for filesystem paths assembled from AJAX parameters or form fields
  • Tests verifying that invalid, traversing, or unexpected module-source identifiers are rejected
  • Web-application monitoring for unusual Superfecta option changes, file uploads, or directory creation by administrative accounts
  • Policies requiring allowlisted handler mappings and non-executable upload locations
  • Automated security review tools that flag unsanitized path use and code-loading behavior

Organizations can look for this weakness through:

  • Static analysis rules identifying dynamic include, require, or equivalent operations using request-derived values
  • Code review checks for filesystem paths assembled from AJAX parameters or form fields
  • Tests verifying that invalid, traversing, or unexpected module-source identifiers are rejected
  • Web-application monitoring for unusual Superfecta option changes, file uploads, or directory creation by administrative accounts
  • Policies requiring allowlisted handler mappings and non-executable upload locations
  • Automated security review tools that flag unsanitized path use and code-loading behavior

Sources

SourceLink
github.comgithub.com/FreePBX/security-reporting/security/advisories/GHSA-j53p-5m8r-j3p6

Frequently asked

questions

It can be exploited through the FreePBX web interface by an authenticated attacker, provided the deployment exposes the affected module and the attacker can satisfy the related filesystem conditions.

Authentication with a known username is required. The practical impact also depends on authorization controls and whether other enabled modules provide directory creation or file-upload capabilities.

Remove user-controlled dynamic PHP inclusion, use a strict allowlist of fixed handlers, validate paths against approved locations, and apply patched vendor code through established maintenance processes.

Treat user input and uploaded files as untrusted, keep uploaded content outside executable paths, enforce least privilege, and use code review or automated analysis to detect dynamic inclusion patterns.

It can be exploited through the FreePBX web interface by an authenticated attacker, provided the deployment exposes the affected module and the attacker can satisfy the related filesystem conditions.

Authentication with a known username is required. The practical impact also depends on authorization controls and whether other enabled modules provide directory creation or file-upload capabilities.

Remove user-controlled dynamic PHP inclusion, use a strict allowlist of fixed handlers, validate paths against approved locations, and apply patched vendor code through established maintenance processes.

Treat user input and uploaded files as untrusted, keep uploaded content outside executable paths, enforce least privilege, and use code review or automated analysis to detect dynamic inclusion patterns.

Find out what's already
exploitable in your codebase.