Prefecthq prefecthq/prefect
Git Argument Injection in prefecthq/prefect
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.
Affected versions and mitigation
From the CVE record, GitHub Security Advisories and the vendor's references.Affected
- >= unspecified, <= latest
- >= 3.1.11, < 3.6.25
Fixed in 3.6.25
from GitHub Security Advisory GHSA-7pm4-56h2-5rxr
Mitigation
Upgrade prefect to 3.6.25 or later.
Timeline
Days relative to CVE publicationFirst public PoC 6.9 days after publication; not in CISA KEV. First PoC: renat0z3r0/prefect-cve-2026-5366 (created 27 Jun 2026, found by us: backfilled).
PoC repositories
Found on GitHub.1 PoCs
PoCs 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| renat0z3r0/prefect-cve-2026-5366 | 27 Jun 2026 +6.9 d | 0 | PoC
Flags · score 15
Below the suspicion threshold (50); does not change the assessment. |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.