/

CVE-2026-45562

Severity:

HIGH RISK

(7.2)

OS Command Injection (CWE-78) in FreePBX Music on Hold

CVE-2026-45562

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(7.2)

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

FreePBX's Music on Hold module stores a user-supplied Asterisk application and later writes it into an Asterisk configuration file without adequate validation. An authenticated FreePBX administrator may abuse this behavior to execute arbitrary system commands with the privileges of the Asterisk service.

FreePBX's Music on Hold module stores a user-supplied Asterisk application and later writes it into an Asterisk configuration file without adequate validation. An authenticated FreePBX administrator may abuse this behavior to execute arbitrary system commands with the privileges of the Asterisk service.

Affected context

The issue occurs in FreePBX deployments using the Music on Hold module when an authenticated administrator can submit a custom Asterisk application through the module's web interface. Risk arises when that value is stored in the database and subsequently written to musiconhold_additional.conf without strict validation before Asterisk processes the configuration.

The issue occurs in FreePBX deployments using the Music on Hold module when an authenticated administrator can submit a custom Asterisk application through the module's web interface. Risk arises when that value is stored in the database and subsequently written to musiconhold_additional.conf without strict validation before Asterisk processes the configuration.

Exploit preconditions

  • Attack surface: FreePBX's authenticated Music on Hold management interface
  • Required access: An existing FreePBX administrator account
  • Trigger point: Processing and loading the generated musiconhold_additional.conf configuration
  • Why exploitation is possible: A custom application value is accepted, stored, and emitted into an Asterisk configuration context without sufficient sanitization or allowlist validation
  • Attack surface: FreePBX's authenticated Music on Hold management interface
  • Required access: An existing FreePBX administrator account
  • Trigger point: Processing and loading the generated musiconhold_additional.conf configuration
  • Why exploitation is possible: A custom application value is accepted, stored, and emitted into an Asterisk configuration context without sufficient sanitization or allowlist validation

Why this happens

The vulnerability results from treating an administrator-controlled POST parameter as trusted configuration data. The value is persisted and later incorporated directly into an Asterisk configuration file, allowing configuration syntax to represent executable behavior rather than only approved application names. This is an OS command injection pattern mapped to CWE-78, because attacker-controlled input reaches a command-execution-capable interpreter without effective validation or neutralization.

The vulnerability results from treating an administrator-controlled POST parameter as trusted configuration data. The value is persisted and later incorporated directly into an Asterisk configuration file, allowing configuration syntax to represent executable behavior rather than only approved application names. This is an OS command injection pattern mapped to CWE-78, because attacker-controlled input reaches a command-execution-capable interpreter without effective validation or neutralization.

Potential impact

  • An attacker may execute arbitrary system commands as the Asterisk service
  • The FreePBX or telephony application runtime could be compromised
  • Call records, credentials, or other accessible data could be exposed or modified
  • The attacker could disrupt telephony services or alter call-handling behavior
  • Additional systems could be targeted if the Asterisk account has excessive permissions
  • An attacker may execute arbitrary system commands as the Asterisk service
  • The FreePBX or telephony application runtime could be compromised
  • Call records, credentials, or other accessible data could be exposed or modified
  • The attacker could disrupt telephony services or alter call-handling behavior
  • Additional systems could be targeted if the Asterisk account has excessive permissions

General mitigation guidance

Mitigation generally focuses on preventing user-controlled values from becoming executable Asterisk configuration.

Common defensive patterns include:

  • Restricting custom application fields to a narrowly defined allowlist of supported values
  • Separating data storage from executable configuration generation
  • Applying context-aware validation before persistence and again before configuration emission
  • Rejecting metacharacters, configuration delimiters, and unexpected syntax rather than attempting weak filtering
  • Using a declarative, non-executable representation for Music on Hold settings where possible
  • Running Asterisk and related services with the minimum filesystem, process, and network privileges required
  • Protecting administrator accounts with strong authentication, role separation, and limited administrative access

Mitigation generally focuses on preventing user-controlled values from becoming executable Asterisk configuration.

Common defensive patterns include:

  • Restricting custom application fields to a narrowly defined allowlist of supported values
  • Separating data storage from executable configuration generation
  • Applying context-aware validation before persistence and again before configuration emission
  • Rejecting metacharacters, configuration delimiters, and unexpected syntax rather than attempting weak filtering
  • Using a declarative, non-executable representation for Music on Hold settings where possible
  • Running Asterisk and related services with the minimum filesystem, process, and network privileges required
  • Protecting administrator accounts with strong authentication, role separation, and limited administrative access

How teams detect issues like this

Detection can combine static analysis, review, and runtime controls:

  • Search for request parameters that are persisted and later concatenated into Asterisk configuration files
  • Flag string construction involving configuration templates, shell-like syntax, or interpreter-facing values
  • Review whether custom application fields use positive validation and fixed mappings
  • Monitor administrative changes to Music on Hold settings and unexpected modifications to generated Asterisk configuration files
  • Enforce code-review and CI policies that prohibit unvalidated user input in executable configuration paths
  • Use neutral automated security review tools to identify command-injection and unsafe configuration-generation patterns

Detection can combine static analysis, review, and runtime controls:

  • Search for request parameters that are persisted and later concatenated into Asterisk configuration files
  • Flag string construction involving configuration templates, shell-like syntax, or interpreter-facing values
  • Review whether custom application fields use positive validation and fixed mappings
  • Monitor administrative changes to Music on Hold settings and unexpected modifications to generated Asterisk configuration files
  • Enforce code-review and CI policies that prohibit unvalidated user input in executable configuration paths
  • Use neutral automated security review tools to identify command-injection and unsafe configuration-generation patterns

Sources

SourceLink
github.comgithub.com/FreePBX/security-reporting/security/advisories/GHSA-4g6v-whq9-944g

Frequently asked

questions

It can be exploited through the FreePBX web interface when the interface is reachable and the attacker has the required administrator credentials.

An existing FreePBX administrator account is required. The vulnerability does not describe unauthenticated exploitation.

Ensure custom application values are selected from a strict allowlist or translated through fixed internal mappings, and prevent untrusted input from being emitted as executable Asterisk configuration.

Treat configuration-generation inputs as untrusted, apply context-aware validation, minimize service privileges, protect administrative access, and monitor changes to generated configuration files.

It can be exploited through the FreePBX web interface when the interface is reachable and the attacker has the required administrator credentials.

An existing FreePBX administrator account is required. The vulnerability does not describe unauthenticated exploitation.

Ensure custom application values are selected from a strict allowlist or translated through fixed internal mappings, and prevent untrusted input from being emitted as executable Asterisk configuration.

Treat configuration-generation inputs as untrusted, apply context-aware validation, minimize service privileges, protect administrative access, and monitor changes to generated configuration files.

Find out what's already
exploitable in your codebase.