CVE-2026-5366: CWE-94 Improper Control of Generation of Code in prefecthq 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.
AI Analysis
Technical Summary
CVE-2026-5366 is a critical vulnerability in prefecthq/prefect version 3.6.23 involving improper control of code generation (CWE-94). The GitRepository storage class fails to validate user-controlled input parameters commit_sha and directories, which are passed directly to git commands without a '--' separator to distinguish user input from git flags. This allows injection of arbitrary git flags such as --upload-pack, enabling execution of external programs. Exploitation requires deployment creation permissions and can lead to arbitrary command execution on worker machines, compromising multi-tenant shared work pools.
Potential Impact
An attacker with deployment creation permissions can exploit this vulnerability to execute arbitrary commands on worker machines. This can lead to full compromise of the affected systems, including unauthorized code execution, data theft, or disruption of services in multi-tenant environments. The vulnerability has a CVSS score of 9.9, indicating critical severity with high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict deployment creation permissions to trusted users only and avoid exposing the affected functionality to untrusted parties. Monitor vendor channels for updates and apply official patches promptly once released.
CVE-2026-5366: CWE-94 Improper Control of Generation of Code in prefecthq prefecthq/prefect
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.
CVSS v3.0
Score 9.9critical
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-5366 is a critical vulnerability in prefecthq/prefect version 3.6.23 involving improper control of code generation (CWE-94). The GitRepository storage class fails to validate user-controlled input parameters commit_sha and directories, which are passed directly to git commands without a '--' separator to distinguish user input from git flags. This allows injection of arbitrary git flags such as --upload-pack, enabling execution of external programs. Exploitation requires deployment creation permissions and can lead to arbitrary command execution on worker machines, compromising multi-tenant shared work pools.
Potential Impact
An attacker with deployment creation permissions can exploit this vulnerability to execute arbitrary commands on worker machines. This can lead to full compromise of the affected systems, including unauthorized code execution, data theft, or disruption of services in multi-tenant environments. The vulnerability has a CVSS score of 9.9, indicating critical severity with high impact on confidentiality, integrity, and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict deployment creation permissions to trusted users only and avoid exposing the affected functionality to untrusted parties. Monitor vendor channels for updates and apply official patches promptly once released.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- @huntr_ai
- Date Reserved
- 2026-04-01T18:18:27.682Z
- Cvss Version
- 3.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a36c95749568db4e21a902c
Added to database: 6/20/2026, 5:09:43 PM
Last enriched: 6/20/2026, 5:24:07 PM
Last updated: 6/20/2026, 6:44:27 PM
Views: 10
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.