/

CVE-2026-46512

Severity:

CRITICAL RISK

(9.9)

Code Injection (CWE-94) in Frogman PBX Dialplan Writer

CVE-2026-46512

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution within Asterisk PBX context

Severity:

CRITICAL RISK

(9.9)

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 code injection flaw in Frogman before version 1.6.2 allows crafted template parameters to be written directly into Asterisk dialplan configuration without adequate sanitization.

Under these conditions, an attacker with write permissions to the dialplan apply mechanism can inject arbitrary Asterisk directives, potentially achieving remote command execution on the PBX host.

Affected context

This vulnerability exists in Frogman deployments that expose the MCP or HTTP API endpoint fm_dialplan_apply and allow callers to supply template parameters such as greeting, dest, url, extension, code, or file.

The issue manifests when Dialplan/Templates.php renders these parameters into extensions_custom.conf, while only context names are sanitized in Dialplan/TemplateBase.php.

Environments where untrusted or semi‑trusted users or automation can trigger dialplan updates are particularly exposed, especially if confirm:true is used to commit changes.

Exploit preconditions

  • Attack surface: MCP and HTTP API providing access to fm_dialplan_apply.
  • Required access: Ability to invoke dialplan apply operations with PERM_WRITE or equivalent privileges.
  • Trigger point: Submission of crafted template parameters (e.g., dest, url, extension, code, file) with confirm:true so that generated dialplan content is written into extensions_custom.conf.
  • Why exploitation is possible: Input fields other than the dialplan context name are embedded into Asterisk configuration without comprehensive sanitization or encoding, allowing injection of arbitrary Asterisk directives such as System(), Set(SHELL(...)), Goto, and Macro.

Why this happens

The root cause is incomplete input validation and context‑aware output handling when generating dialplan configuration from user‑controlled parameters.

While contextName() is sanitized, other templated values are treated as trusted and interpolated directly into extensions_custom.conf by Dialplan/Templates.php.

This aligns with CWE-94: Improper Control of Generation of Code ('Code Injection'), because user input is incorporated into a configuration language that supports executable constructs (Asterisk applications and functions), effectively allowing attackers to supply code-like directives that will be interpreted by the PBX.

Potential impact

  • Execution of arbitrary OS commands via Asterisk System() or Set(SHELL(...)) directives.
  • Complete compromise of the PBX host operating system and telephony services.
  • Call interception, call redirection, or unauthorized call routing via Goto or Macro injection.
  • Fraudulent call generation leading to toll fraud and financial loss.
  • Tampering with call recording, voicemail, or logging behaviors within Asterisk.

General mitigation guidance

Effective mitigation focuses on limiting how untrusted data reaches dialplan code and constraining what the dialplan is allowed to execute.

Pattern-based approaches include:

  • Applying strict, context‑sensitive validation for all template parameters that can reach Asterisk configuration, using whitelists or structured types rather than free‑form strings.
  • Separating data fields (e.g., phone numbers, URIs, filenames) from executable dialplan snippets, and prohibiting user-supplied content from being interpreted as Asterisk applications or functions.
  • Generating dialplan content through a constrained template engine that escapes or encodes special characters and disallows control constructs where user input appears.
  • Reducing PBX runtime privileges so that even if dialplan injection occurs, the process has minimal access to the underlying system and shell.
  • Restricting which internal actors can perform dialplan apply operations and requiring stronger authentication and authorization around PERM_WRITE actions.

How teams detect issues like this

Detection typically combines code, configuration, and runtime monitoring:

  • Static analysis or secure code review focusing on template rendering paths that write to extensions_custom.conf, flagging any concatenation of user-controlled parameters into Asterisk directives.
  • Pattern-based searches for locations where Asterisk functions like System(), SHELL, Goto, or Macro appear near unsanitized variables inside templates.
  • Configuration auditing to detect unexpected or anomalous dialplan entries, especially those invoking shell commands or unusual call routing logic.
  • Runtime monitoring and alerting for suspicious outbound calls, abnormal call volumes, or unexpected usage of System()/SHELL from the PBX process.
  • Integration of automated SAST/IAST tools into CI pipelines to enforce rules around configuration generation and template safety.

Sources

SourceLink
github.comgithub.com/mwtcmi/frogman/commit/36a05ffa2df1d256b6f6f7c3b66ef77ebe3e458a
github.comgithub.com/mwtcmi/frogman/releases/tag/v1.6.1
github.comgithub.com/mwtcmi/frogman/releases/tag/v1.6.2
github.comgithub.com/mwtcmi/frogman/security/advisories/GHSA-pxfc-q72v-jh8m

Frequently asked

questions

Exploitability is high wherever fm_dialplan_apply is reachable by users or systems that can provide custom template parameters with write permissions. The risk increases significantly in multi-tenant or automated environments where dialplan updates are triggered programmatically.

Yes. An attacker must be able to invoke dialplan apply operations with PERM_WRITE or equivalent authorization. However, if these privileges are granted too broadly or are exposed through upstream integrations, an adversary may be able to leverage them.

The safest pattern is to treat all template parameters as untrusted data and apply strict, context‑appropriate validation and encoding before they reach any executable dialplan construct. User-controlled values should never be allowed to form raw Asterisk directives or introduce new applications/functions into the configuration.

Prevention involves designing configuration generation systems so that code and data are strictly separated, applying sanitization to every field that can influence generated configuration, and enforcing security reviews of template engines and dialplan writers. Adding automated checks for dangerous Asterisk applications near user input and minimizing the privileges of dialplan management interfaces further reduces the risk of recurrence.

Find out what's already
exploitable in your codebase.