← Back to CVE Explorer

CVE-2026-5366

Full vulnerability record from the local CVENow database.

Description

Prefect version 3.6.23 is vulnerable to remote code execution due to improper handling of user-controlled input in the `GitRepository` storage class. The `commit_sha` parameter, which is passed to git commands, lacks validation and does not include a `--` separator to distinguish user input from git flags. This allows attackers to inject arbitrary git flags, such as `--upload-pack`, enabling execution of external programs. Additionally, the `directories` parameter can be exploited to inject git flags during sparse-checkout operations. These vulnerabilities allow any user with deployment creation permissions to execute arbitrary commands on worker machines, compromising shared work pools in multi-tenant environments.

Severity
CRITICAL
CVSS score
9.9 (v3.0)
Vulnerability status
Analyzed
Source identifier
Published
2026-06-20 17:16:26.560000
Last modified
2026-10-25 23:10:00.167000
View original CVE JSON
{
  "id": "CVE-2026-5366",
  "sourceIdentifier": "[email protected]",
  "published": "2026-06-20T17:16:26.560",
  "lastModified": "2026-10-25T23:10:00.167",
  "vulnStatus": "Analyzed",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "Prefect version 3.6.23 is vulnerable to remote code execution due to improper handling of user-controlled input in the `GitRepository` storage class. The `commit_sha` parameter, which is passed to git commands, lacks validation and does not include a `--` separator to distinguish user input from git flags. This allows attackers to inject arbitrary git flags, such as `--upload-pack`, enabling execution of external programs. Additionally, the `directories` parameter can be exploited to inject git flags during sparse-checkout operations. These vulnerabilities allow any user with deployment creation permissions to execute arbitrary commands on worker machines, compromising shared work pools in multi-tenant environments."
    },
    {
      "lang": "es",
      "value": "La versión 3.6.23 de Prefect es vulnerable a ejecución remota de código debido a un manejo inadecuado de la entrada controlada por el usuario en la clase de almacenamiento ’GitRepository’. El parámetro ’commit_sha’, que se pasa a los comandos de git, carece de validación y no incluye un separador ’--’ para distinguir la entrada del usuario de las banderas de git. Esto permite a los atacantes inyectar banderas de git arbitrarias, como ’--upload-pack’, lo que permite la ejecución de programas externos. Además, el parámetro ’directories’ puede ser explotado para inyectar banderas de git durante operaciones de sparse-checkout. Estas vulnerabilidades permiten a cualquier usuario con permisos de creación de despliegues ejecutar comandos arbitrarios en máquinas de trabajo, comprometiendo los pools de trabajo compartidos en entornos multi-inquilino."
    }
  ],
  "affected": [
    {
      "source": "[email protected]",
      "affectedData": [
        {
          "vendor": "prefecthq",
          "product": "prefecthq/prefect",
          "versions": [
            {
              "version": "unspecified",
              "lessThanOrEqual": "latest",
              "versionType": "custom",
              "status": "affected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV30": [
      {
        "source": "[email protected]",
        "type": "Secondary",
        "cvssData": {
          "version": "3.0",
          "vectorString": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
          "baseScore": 9.9,
          "baseSeverity": "CRITICAL",
          "attackVector": "NETWORK",
          "attackComplexity": "LOW",
          "privilegesRequired": "LOW",
          "userInteraction": "NONE",
          "scope": "CHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 3.1,
        "impactScore": 6.0
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-06-22T17:24:58.249220Z",
          "id": "CVE-2026-5366",
          "options": [
            {
              "exploitation": "poc"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "total"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "weaknesses": [
    {
      "source": "[email protected]",
      "type": "Secondary",
      "description": [
        {
          "lang": "en",
          "value": "CWE-94"
        }
      ]
    }
  ],
  "configurations": [
    {
      "nodes": [
        {
          "operator": "OR",
          "negate": false,
          "cpeMatch": [
            {
              "vulnerable": true,
              "criteria": "cpe:2.3:a:prefect:prefect:3.6.23:-:*:*:*:*:*:*",
              "matchCriteriaId": "8305547A-5D60-463F-8056-82B8F68F91CB"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "url": "https://huntr.com/bounties/e2e88a0f-a8f6-49c9-94c5-e98dc385f07a",
      "source": "[email protected]",
      "tags": [
        "Exploit",
        "Third Party Advisory"
      ]
    },
    {
      "url": "https://huntr.com/bounties/e2e88a0f-a8f6-49c9-94c5-e98dc385f07a",
      "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
      "tags": [
        "Exploit",
        "Third Party Advisory"
      ]
    }
  ]
}