Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-108161 Overview
CVE-2026-108161 is an OS command injection vulnerability [CWE-78] affecting FusionPBX through version 5.6.5. The flaw resides in the call_recordings::download() function, which fails to sanitize caller ID values used to construct a shell command. Unauthenticated attackers can place calls containing shell metacharacters such as $(...) in the Caller-ID name or number. When the record_name filename template is enabled and a privileged user later downloads multiple recordings as a ZIP archive, the embedded payload executes as the web server user.
Critical Impact
Remote attackers can achieve arbitrary command execution on the FusionPBX host as the web server user, enabling full compromise of the PBX, call data, and potentially pivoting into connected telephony infrastructure.
Affected Products
- FusionPBX versions through 5.6.5
- Deployments with the record_name filename template enabled
- Installations exposing SIP endpoints to untrusted networks
Discovery Timeline
- 2026-10-10 - CVE-2026-108161 published to NVD
- 2026-10-16 - Last updated in NVD database
Technical Details for CVE-2026-108161
Vulnerability Analysis
The vulnerability exists in app/call_recordings/resources/classes/call_recordings.php within the download() method. The code builds a filename for a symbolic link by substituting placeholder tokens such as ${day} and ${time} into a user-controlled template. The resulting string is then passed directly to PHP's system() call via an ln -s command without any sanitization or escaping.
When the record_name template includes caller ID fields, the Caller-ID name or number provided during call setup becomes part of the shell command. An attacker can place a SIP call with a crafted Caller-ID containing $(...) command substitution. The malicious filename persists in the recording metadata until a privileged user triggers a multi-recording ZIP download, at which point the shell interprets the embedded payload.
Root Cause
The root cause is the direct concatenation of untrusted input into a command string executed by system(). Neither escapeshellarg() nor input validation was applied before constructing the ln -s invocation. Caller ID values are controlled by the remote SIP peer and traverse the system without filtering of shell metacharacters.
Attack Vector
Exploitation requires an attacker to place a SIP call to the FusionPBX instance with a malicious Caller-ID value. Execution is deferred until an authenticated administrator initiates a bulk ZIP download of recordings. The attacker needs no credentials, but exploitation depends on user interaction and the record_name configuration being active.
//Vulnerable code (pre-patch) and fix from commit 074a69310100f95171c67db62643cc2aac4f4d37
$call_recording_name_download = str_replace('${day}', $call_recording_day, $call_recording_name_download);
$call_recording_name_download = str_replace('${time}', $call_recording_time, $call_recording_name_download);
// Vulnerable: unsanitized input passed directly to system()
// $command = 'ln -s ' . $call_recording_path . '/' . $call_recording_name . ' ' . $call_recording_path . '/' . $call_recording_name_download;
// Patched: strip unsafe characters and quote arguments
$call_recording_name_download = preg_replace('/[^\p{L}\p{N}_\-\.]/u', '', $call_recording_name_download);
$call_recording_name_download = preg_replace('/\.{2,}/', '.', $call_recording_name_download);
$call_recording_name_download = trim($call_recording_name_download, '.');
$command = 'ln -s ' . escapeshellarg($call_recording_path . '/' . $call_recording_name) . ' ' . escapeshellarg($call_recording_path . '/' . $call_recording_name_download);
system($command);
Source: FusionPBX Commit 074a693
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-108161
Indicators of Compromise
- Call Detail Records (CDRs) containing Caller-ID values with $(, backticks, pipes, or other shell metacharacters
- Unexpected child processes spawned by the web server user (for example www-data, apache, nginx) after a recording ZIP download
- Symbolic links in the recordings directory with names containing shell syntax or non-printable characters
- Outbound network connections originating from the PHP-FPM or web server process shortly after ZIP downloads
Detection Strategies
- Inspect FreeSWITCH CDR logs for Caller-ID fields that fail to match an allow-list of expected characters
- Monitor for ln -s invocations with unusual arguments in process execution telemetry
- Alert on web server processes executing shells (sh, bash) or network utilities (curl, wget, nc)
Monitoring Recommendations
- Enable detailed audit logging for the FusionPBX recordings module and administrator download actions
- Forward FreeSWITCH event logs and web server process telemetry to a central analytics platform for correlation
- Review recording filenames periodically for unexpected characters or structure
How to Mitigate CVE-2026-108161
Immediate Actions Required
- Apply the upstream patch from FusionPBX commit 074a693 or upgrade to a fixed release once published
- Disable the record_name filename template feature until the patch is applied
- Restrict SIP access at the network perimeter to known trunks and endpoints
- Audit existing recording filenames for shell metacharacters and remove suspicious entries
Patch Information
The fix sanitizes the generated filename by stripping all characters outside Unicode letters, digits, underscore, hyphen, and period. It collapses runs of dots to prevent path traversal and wraps both arguments to ln -s with escapeshellarg(). Administrators should pull the latest master branch from the FusionPBX GitHub Repository or wait for the next tagged release. See the VulnCheck advisory for additional context.
Workarounds
- Set the recording filename template to use only server-generated values such as UUID or timestamp, excluding caller ID
- Restrict administrator access to the call recordings download interface via network ACLs or VPN
- Deploy a SIP-aware proxy that validates Caller-ID headers against an allow-list before forwarding to FusionPBX
# Example FusionPBX setting change: avoid caller-id tokens in record_name template
# Navigate: Advanced > Default Settings > call_recordings > record_name
# Replace templates referencing ${caller_id_name} or ${caller_id_number} with a safe pattern:
${uuid}_${strftime(%Y%m%d_%H%M%S)}
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

