---
id: CVE-2026-40520
title: FreePBX api module Command Injection via GraphQL
summary: >-
  FreePBX api module version 17.0.8 and prior contain a command injection
  vulnerability in the initiateGqlAPIProcess() function where GraphQL mutation
  input fields are passed directly to shell_exec() without sanitization or
  escaping. An au…
severity: high
cvss: 7.2
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H'
cvssSource: cna
cwe:
  - CWE-78
vendor: FreePBX
product: api
affected:
  - api <= 17.0.8
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: total
  timestamp: '2026-04-21T13:31:32.268711Z'
published: '2026-04-21'
updated: '2026-09-24'
sourceUpdated: '2026-09-24T14:17:37.983Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-40520'
references:
  - url: >-
      https://github.com/FreePBX/api/commit/5f194e39a47e5481e8947f9694304d32724175f6
  - url: >-
      https://github.com/FreePBX/api/blob/5f194e39a47e5481e8947f9694304d32724175f6/Api.class.php#L546C1-L554C3
  - url: >-
      https://github.com/FreePBX/api/blob/5f194e39a47e5481e8947f9694304d32724175f6/ApiGqlHelper.class.php#L34C1-L36C136
  - url: >-
      https://www.vulncheck.com/advisories/freepbx-api-module-command-injection-via-graphql
tags:
  - cve.org
epss: 0.02424
epssPercentile: 0.83488
ingestedAt: '2026-09-24T15:45:56.731Z'
---

## Overview

FreePBX api module version 17.0.8 and prior contain a command injection vulnerability in the initiateGqlAPIProcess() function where GraphQL mutation input fields are passed directly to shell_exec() without sanitization or escaping. An authenticated user with a valid bearer token can send a GraphQL moduleOperations mutation with backtick-wrapped commands in the module field to execute arbitrary commands on the underlying host as the web server user.

## Affected

- `api <= 17.0.8`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
