Prefect has Git Flag Injection via commit_sha and directories Parameters Leading to Remote Code Execution (RCE)
Prefect versions 3.1.11 through 3.6.24 are 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 software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | prefect | >= 3.1.11, < 3.6.25 | 3.6.25 |
References
- CVSS vector
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H- Weakness (CWE)
CWE-94- Platform
- Python (PyPI)
- Package
prefect- Disclosed
- 20.06.2026
- Updated
- 04.11.2026 00:17
Sources and licenses
OSV / GitHub Advisory Database - GHSA-7pm4-56h2-5rxr - CC BY 4.0
Vulnerability history: prefect
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 9
- First → latest
- 11.2023 06.2026
- Without a fix
- 1
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 4
- Medium 2
- Low 2
Disclosures per year
- 2023: 1
- 2024: 0
- 2025: 1
- 2026: 7
-
Prefect has Git Flag Injection via commit_sha and directories Parameters Leading to Remote Code Execution (RCE) this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.