Prefect has an Argument Injection issue
The GitHubRepository block in the prefect-github integration concatenates the user-supplied reference field directly into a git clone command string without sanitisation, then parses it with shlex.split(). An attacker could inject arbitrary git command-line options such as -c, potentially leading to server-side request forgery, credential theft, or remote code execution.
prefect
Originally disclosed on huntr
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.
From the GitHub Advisory Database (GHSA-cw25-2p92-7f75, CC BY 4.0).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker could inject git options to cause server-side request forgery, steal credentials, or achieve remote code execution, though the text does not demonstrate a working exploit.
What the attacker needed
Control over the reference field; prefect-github integration in use
The fix
The command should be built as an argument list rather than a concatenated string, as the GitLab and BitBucket integrations already do.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When software builds a command by gluing text together, any part of that text that a user can control can sneak in extra instructions. Here, a field meant to name a git branch or tag is pasted into a git clone command, so an attacker can add their own git options. Those options can make git fetch from an attacker's server, leak credentials, or run code.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.