Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-72538

CVE-2026-72538: PrefectHQ Prefect RCE Vulnerability

CVE-2026-72538 is an argument injection flaw in PrefectHQ Prefect through 3.8.2 that enables authenticated users to execute remote code via git_clone. This article covers technical details, impact, and mitigations.

Updated:

CVE-2026-72538 Overview

CVE-2026-72538 is an argument injection vulnerability in PrefectHQ Prefect through version 3.8.2. Authenticated users can achieve remote code execution by abusing the branch field of the git_clone pull step. The branch parameter flows directly into git pull without sanitization, letting attackers inject arbitrary git command-line arguments. This code path is distinct from the incomplete fix applied for CVE-2026-5366 and results in command execution on the Prefect server itself. The weakness is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command.

Critical Impact

Any authenticated Prefect user can execute arbitrary commands on the Prefect server through a crafted branch value in a git_clone pull step, compromising workflow orchestration infrastructure and any secrets it manages.

Affected Products

  • PrefectHQ Prefect through 3.8.2
  • Deployments using the git_clone pull step for flow source retrieval
  • Prefect servers accepting deployments from authenticated users

Discovery Timeline

  • 2026-08-11 - CVE-2026-72538 published to NVD
  • 2026-08-11 - Last updated in NVD database

Technical Details for CVE-2026-72538

Vulnerability Analysis

Prefect is a workflow orchestration platform that fetches flow code at runtime using pull steps. The git_clone pull step accepts a branch field intended to specify which git branch to check out. Prefect passes this value directly to the underlying git pull invocation without validating or escaping argument delimiters.

Because the parameter is not separated from other arguments by --, git interprets any value beginning with - as an option. An attacker can supply option-like values such as --upload-pack to trigger execution of an arbitrary binary through git's transport mechanism. The result is command execution in the Prefect server process context.

This issue is a distinct code path from the fix applied for CVE-2026-5366. The earlier remediation did not extend to the branch parameter handling in the pull step logic, leaving the injection sink open.

Root Cause

The root cause is missing argument sanitization when constructing the git pull command. Prefect concatenates user-controlled branch input into the argument list without prefixing an end-of-options marker (--) or rejecting values that begin with -. This falls squarely within CWE-88, argument injection through unsafe command construction.

Attack Vector

Exploitation requires authenticated access to a Prefect instance with permission to create or modify a deployment that uses git_clone. The attacker sets the branch value to a git option that causes git to invoke an attacker-controlled program during the pull operation. When the Prefect worker or server executes the pull step, the injected argument is honored by git, and the malicious binary or command runs with the privileges of the Prefect process. See the PrefectHQ Prefect repository for source references.

Detection Methods for CVE-2026-72538

Indicators of Compromise

  • Deployment configurations containing branch values that begin with - or -- in git_clone pull steps
  • Unexpected child processes spawned by Prefect worker or server processes, such as shells, interpreters, or network utilities
  • Outbound network connections initiated by the Prefect service to unrecognized hosts during flow pull operations
  • Modifications to deployment YAML or API-created deployments introducing suspicious git_clone parameters

Detection Strategies

  • Audit all stored deployments and pull step definitions for branch values containing option-like syntax
  • Instrument the host running Prefect to log process creation events and alert on git-spawned processes other than expected git helpers
  • Monitor Prefect API access logs for deployment create and update operations from unusual accounts or locations

Monitoring Recommendations

  • Enable process telemetry on Prefect hosts to capture parent-child relationships between the Prefect service, git, and any downstream binaries
  • Alert on any git pull invocation where an argument begins with - beyond the expected flags
  • Correlate deployment change events with subsequent worker execution to identify weaponized configurations

How to Mitigate CVE-2026-72538

Immediate Actions Required

  • Upgrade PrefectHQ Prefect to a version later than 3.8.2 that remediates the branch argument injection path
  • Restrict deployment creation and modification privileges to trusted operators until patching is complete
  • Review existing deployments and remove or sanitize any git_clone pull steps with suspicious branch values
  • Rotate credentials, tokens, and secrets accessible to the Prefect server, since authenticated RCE may have exposed them

Patch Information

Refer to the PrefectHQ Prefect repository for the fixed release and commit history addressing the git_clone branch parameter. Apply the vendor-supplied update to versions beyond 3.8.2. Verify the fix by confirming the patched code path validates branch names against a strict allowlist or inserts an end-of-options separator before user input.

Workarounds

  • Disable use of the git_clone pull step where feasible and pull flow source through pre-vetted container images or object storage
  • Enforce a strict allowlist on the branch field via a wrapper or admission control, rejecting any value that starts with -
  • Run the Prefect server and workers under least-privilege service accounts with no interactive shell and restricted outbound network egress
  • Require review and approval workflows for any deployment configuration change that references a git pull step
bash
# Configuration example: reject option-like branch values via pre-commit validation
grep -RE 'branch:\s*["\\x27]?-' deployments/ && \
  echo "Rejected: branch value begins with '-'" && exit 1

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.