CVE-2026-5366 Git Argument Injection in prefecthq/prefect

Critical 9.9 Published Updated

Attackers with deployment permissions can execute arbitrary commands on worker machines by injecting git flags into Prefect storage parameters.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2026-5366?

CVE-2026-5366 is a critical command injection vulnerability in prefecthq/prefect, published on 20 Jun 2026. Any signed-in user can exploit it over the network, with no action from the victim.

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

Weakness: CWE-94

Which versions are affected by CVE-2026-5366?

It affects 1 product.

Products include Prefect Prefect.

How do I fix CVE-2026-5366?

No fix has been published for CVE-2026-5366 yet. Limit exposure of the affected software until one is available.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2026-5366 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-5366 exists.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as GHSA-7pm4-56h2-5rxr.

Is CVE-2026-5366 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free