---
title: "CVE-2026-5366: Prefect has Git Flag Injection via commit_sha and directories Parameters Leading to Remote Code Execution (RCE)"
url: https://erroneo.us/security/cve/CVE-2026-5366/
description: "CVE-2026-5366 (prefect (PyPI)): Prefect version 3.6.23 is vulnerable to remote code execution due to improper handling of user-controlled input in the…"
type: vulnerability-record
section: "Security Digest"
date_published: 2026-06-20
date_modified: 2026-11-03
publisher: erroneo.us
author: erroneo.us Security Desk
cve: "CVE-2026-5366"
kev: false
cvss: 9.9
epss: 0.01034
license: All rights reserved. Quote with attribution and a link.
---

# CVE-2026-5366: Prefect has Git Flag Injection via commit_sha and directories Parameters Leading to Remote Code Execution (RCE)

**Signal:** Critical, preconditions apply. Severe if exploited, but exploitation needs conditions that may not apply to you. (Computed from CISA KEV, EPSS and CVSS; not an editorial verdict.)

## Should you act?

- Not in CISA KEV , but CISA’s SSVC assessment records a public proof-of-concept, so attack code exists.
- EPSS 1.0% , percentile 64: FIRST’s model estimates a 1.0% chance of exploitation activity in the next 30 days, higher than 64% of all scored CVEs (moderate). EPSS is a probability, not a verdict.
- Needs an account (low (any account)). Exposure depends on who can log in.
- Only applies if your dependency tree includes prefect (PyPI) >= 3.1.11, < 3.6.25, fixed in 3.6.25 . Check your lockfile, including transitive dependencies.

## What it is

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 packages

- PyPI `prefect` >= 3.1.11, < 3.6.25 → fixed: 3.6.25

## Affected products (CVE record)

- prefecthq prefecthq/prefect: unspecified <= latest

## Severity

- @huntr_ai CVSS 3.0: 9.9 `CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`
- GitHub CVSS 3.1: 9.9 `CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H`

## Exploitation

- CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
- CISA SSVC assessment: exploitation poc , automatable no , technical impact total .
- FIRST EPSS (model of 2026-11-04): 1.03% probability of exploitation activity in the next 30 days; percentile 64.

## Sources

- [GitHub Advisory GHSA-7pm4-56h2-5rxr](https://github.com/advisories/GHSA-7pm4-56h2-5rxr)
- [CVE.org record CVE-2026-5366](https://www.cve.org/CVERecord?id=CVE-2026-5366)
- [NVD entry CVE-2026-5366](https://nvd.nist.gov/vuln/detail/CVE-2026-5366)
- [huntr.com](https://huntr.com/bounties/e2e88a0f-a8f6-49c9-94c5-e98dc385f07a)
- [github.com](https://github.com/PrefectHQ/prefect/pull/21384)
- [github.com](https://github.com/PrefectHQ/prefect/commit/6a9d9918716ce4ee0297b69f3046f7067ef1faae)

---
Source page: https://erroneo.us/security/cve/CVE-2026-5366/ · Security Digest: https://erroneo.us/security/ · More: https://erroneo.us/llms.txt
