CVE-2026-5366
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.
Weakness
- CWE-94: Improper Control of Generation of Code
CISA SSVC decision points
| Exploitation | poc |
|---|---|
| Automatable | no |
| Technical impact | total |
| Scored | 2026-06-22 |
Timeline
- 2026-06-20Published by the CNA16:43 UTC
- 2026-06-20GitHub advisory published (GHSA-7pm4-56h2-5rxr)same day
- 2026-06-22CISA SSVC decision recorded2 days after publication
Exploit and advisory records
GitHub advisory GHSA-7pm4-56h2-5rxr, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| PyPI prefect | from 3.1.11 before 3.6.25 | 3.6.25 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| prefect prefect | 3.6.23no fix listed | not listed |
References
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2026-5366'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2026-5366'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2026-5366'curl 'https://api.contrastcyber.com/cve_products/CVE-2026-5366'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).