RCE in Prefect

CVE-2026-5366

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.

Vulnerability class: RCE (Remote Code Execution)

Published · last modified .

CVSS v3 metric

CVSS v3 base score 9.9 (Critical). Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.

EPSS exploit prediction

EPSS 0.010, 64.4th percentile (scored ); unchanged over 30 days. About EPSS.

Affected products

Weakness classification (CWE)

Public exploits and proof-of-concept code

1 public repository with exploit or proof-of-concept code for this CVE:

  • renat0z3r0/prefect-cve-2026-5366 (last pushed 2026-06-27): PoC for CVE-2026-5366: git argument injection in Prefect's GitRepository leading to RCE on the worker.

References