CVE-2026-5366: 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 commitsha 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 Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
prefecthq/prefectto a version that resolves this vulnerability.Fixed in 3.6.23 - Compensating control
Restrict who can create deployments so that only trusted users can trigger vulnerable `GitRepository` sparse-checkout/commit operations on worker machines (multi-tenant shared work pools risk).
Event History
Frequently Asked Questions
What is the severity of CVE-2026-5366?
CVE-2026-5366 has a critical severity score of 9.9.
How do I fix CVE-2026-5366?
To fix CVE-2026-5366, upgrade to Prefect version 3.6.24 or later, which includes the necessary validation for user input.
What type of vulnerability is CVE-2026-5366?
CVE-2026-5366 is classified as a code injection vulnerability leading to remote code execution.
Which software is affected by CVE-2026-5366?
CVE-2026-5366 affects the Prefect software available on PyPI.
What is the cause of CVE-2026-5366?
CVE-2026-5366 is caused by improper handling of the `commit_sha` parameter in the `GitRepository` storage class.