RCE in Freepbx API
CVE-2026-40520
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.
Vulnerability class: Command Injection (OS Command Injection)
Published · last modified .
CVSS v3 metric
CVSS v3 base score 7.2 (High). Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H.
EPSS exploit prediction
EPSS 0.014, 72.6th percentile (scored ); down from 0.024 30 days earlier. About EPSS.
EPSS over last 30 days · oldest: 0.024 · newest: 0.014 · change: -0.010
Affected products
- Freepbx API — versions 0, 5f194e39a47e5481e8947f9694304d32724175f6
Weakness classification (CWE)
References
- github.com/FreePBX/api/commit/5f194e39a47e5481e8947f9694304d32724175f6 (Patch, patch)
- github.com/FreePBX/api/blob/5f194e39a47e5481e8947f9694304d32724175f6/Api.class… (related, Product)
- github.com/FreePBX/api/blob/5f194e39a47e5481e8947f9694304d32724175f6/ApiGqlHelp… (related, Product)
- www.vulncheck.com/advisories/freepbx-api-module-command-injection-via-graphql (Third Party Advisory, third-party-advisory)