CVE-2026-5366: Git Argument Injection in prefecthq/prefect

Published Jun 20, 2026
·
Updated

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

2 affected components
pypi/prefect=3.6.23
Prefect Prefect=3.6.23

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade prefecthq/prefect to a version that resolves this vulnerability.

    Fixed in 3.6.23
  2. 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

Jun 20, 2026
CVE Published
via MITRE·04:43 PM
Data Sourced
via MITRE·04:43 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:16 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-5366?

CVE-2026-5366 has a critical severity score of 9.9.

2

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.

3

What type of vulnerability is CVE-2026-5366?

CVE-2026-5366 is classified as a code injection vulnerability leading to remote code execution.

4

Which software is affected by CVE-2026-5366?

CVE-2026-5366 affects the Prefect software available on PyPI.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203