CVE-2026-5366 — Vulnerability in prefect — CVE Details
Prefect has Git Flag Injection via commit_sha and directories Parameters Leading to Remote Code Execution (RCE)
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.03%). Schedule for your next planned update.
Does your project use an affected prefect version?
Paste your requirements.txt to check it for CVE-2026-5366 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Advisory Timeline
- First published June 20, 2026 (159 days ago).
- Last revised November 3, 2026 — 136 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "prefect>=3.6.25"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| prefect PyPI · Affected: 3.1.11, 3.1.12, 3.1.12.dev1, 3.1.12.dev2 (+338 more) | 3.6.25 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-94Code InjectionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.9 score means for each attack dimension.
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-5366ADVISORY
- https://github.com/PrefectHQ/prefect/pull/21384WEB
- https://github.com/PrefectHQ/prefect/commit/6a9d9918716ce4ee0297b69f3046f7067ef1faaeWEB
- https://github.com/PrefectHQ/prefectPACKAGE
- https://huntr.com/bounties/e2e88a0f-a8f6-49c9-94c5-e98dc385f07aWEB
Frequently Asked Questions
- What is CVE-2026-5366?
- Prefect has Git Flag Injection via commit_sha and directories Parameters Leading to Remote Code Execution (RCE). This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.9/10).
- How do I check if my project is affected by CVE-2026-5366?
- CVE-2026-5366 affects prefect. It has a 1.0% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-5366 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This is an above-median EPSS score — 63.1% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-77359CRITICAL
Jupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routes
- CVE-2026-77312CRITICAL
Flyto2 Core: Arbitrary file write via unguarded data.*/file.* modules (incomplete fix of CVE-2026-67429)