Argument Injection in prefecthq/prefect
Description
A vulnerability in the GitHubRepository block of the prefect-github integration in Prefect version 3.6.18 allows an attacker to inject arbitrary git command-line options via the reference field. The reference field is concatenated directly into a git clone command string without proper sanitization, and then parsed by shlex.split(). This enables injection of options such as -c, leading to potential Server-Side Request Forgery (SSRF), credential theft, or remote code execution (RCE). The vulnerability affects both the aget_directory() and get_directory() methods in src/integrations/prefect-github/prefect_github/repository.py. This issue does not affect the GitLab and BitBucket integrations, which use a safer list-based command construction approach.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Prefect 3.6.18's prefect-github integration allows git command injection via the `reference` field, enabling SSRF, credential theft, or RCE.
Vulnerability
In Prefect version 3.6.18, the GitHubRepository block of the prefect-github integration contains a command injection vulnerability in the reference field. The field is concatenated directly into a git clone command string without sanitization and then parsed by shlex.split(). This affects both the aget_directory() and get_directory() methods in src/integrations/prefect-github/prefect_github/repository.py. The GitLab and BitBucket integrations are not affected as they use a safer list-based command construction approach [1].
Exploitation
An attacker who can control the reference field in a GitHubRepository block can inject arbitrary git command-line options, such as -c, by crafting a malicious string. This injection occurs during the command construction before shlex.split() is applied, allowing the attacker to execute unintended git commands or options. No authentication or special privileges are required beyond the ability to supply the reference value [1].
Impact
Successful exploitation can lead to Server-Side Request Forgery (SSRF), credential theft, or remote code execution (RCE) in the context of the Prefect agent. The attacker may gain access to sensitive data, internal network resources, or execute arbitrary commands on the host system [1].
Mitigation
As of the publication date, no patch has been disclosed in the available references. Users can mitigate the risk by avoiding the use of untrusted input in the reference field, or by using the GitLab or BitBucket integrations, which are not vulnerable to this injection [1].
AI Insight generated on May 24, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
1News mentions
0No linked articles in our index yet.