{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "cpe": "cpe:2.3:a:freepbx:api:*:*:*:*:*:*:*:*",
            "extracted_events": [
              {
                "introduced": "0"
              },
              {
                "fixed": "17.0.8"
              }
            ],
            "source": [
              "CPE_RANGE",
              "REFERENCES"
            ]
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "ca10ea7d9d72d118ab40484ec3f969aff25f685d"
            },
            {
              "fixed": "5f194e39a47e5481e8947f9694304d32724175f6"
            }
          ],
          "repo": "https://github.com/freepbx/api",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "VulnCheck",
    "cwe_ids": [
      "CWE-78"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40520.json"
  },
  "details": "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.",
  "id": "CVE-2026-40520",
  "modified": "2026-07-08T05:39:25.381436335Z",
  "published": "2026-04-21T12:41:05.281Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/FreePBX/api/blob/5f194e39a47e5481e8947f9694304d32724175f6/Api.class.php#L546C1-L554C3"
    },
    {
      "type": "WEB",
      "url": "https://github.com/FreePBX/api/blob/5f194e39a47e5481e8947f9694304d32724175f6/ApiGqlHelper.class.php#L34C1-L36C136"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40520.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40520"
    },
    {
      "type": "ADVISORY",
      "url": "https://www.vulncheck.com/advisories/freepbx-api-module-command-injection-via-graphql"
    },
    {
      "type": "FIX",
      "url": "https://github.com/FreePBX/api/commit/5f194e39a47e5481e8947f9694304d32724175f6"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/FreePBX/api"
    }
  ],
  "schema_version": "1.7.5",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "FreePBX api module Command Injection via GraphQL"
}