Security Digest · Vulnerability record

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

Prefect version 3.6.23 is vulnerable to remote code execution due to improper handling of user-controlled input in the GitRepository storage class.

CVSS 9.9 Critical EPSS 1.0% · p64

Should you act?

Critical, preconditions apply

Severe if exploited, but exploitation needs conditions that may not apply to you. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • 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.

From the GitHub advisory

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 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.

Weakness type: CWE-94.

Product: prefect (PyPI) · Assigned by: @huntr_ai · Published: 2026-06-20

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
PyPIprefect>= 3.1.11, < 3.6.253.6.25
VendorProductAffected versions (per CVE record)
prefecthqprefecthq/prefectunspecified <= latest

Severity scores

Scored byCVSSScoreVector
@huntr_ai3.09.9 CriticalCVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
GitHub3.19.9 CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Privileges required: low (any account)
  • User interaction: none
  • Scope: changed (can affect other components)

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • 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.

Timeline

  • — CVE record published by @huntr_ai
  • — GitHub-reviewed advisory GHSA-7pm4-56h2-5rxr published (critical)
  • — CVE record last updated

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vulnerability records

  1. GitHub Advisory GHSA-7pm4-56h2-5rxr github.com
  2. CVE.org record CVE-2026-5366 cve.org
  3. NVD entry CVE-2026-5366 nvd.nist.gov

Other references from the CVE record and advisory

  1. huntr.com huntr.com
  2. github.com github.com
  3. github.com github.com

Critical PyPI advisories · Today’s Security Digest