Skip to content
RCE Disclosed report Intermediate CVE-2022-1440

Command injection in git-interface

The git-interface tool passed user-supplied remote and destination values into a git clone command that supported the --upload-pack option, allowing an attacker to run arbitrary operating system commands. This could lead to full command execution on the host running the tool.

yarkeev/git-interface

Originally disclosed on huntr

Critical View original

A command injection vulnerability exists in git-interface in the GitHub repository yarkeev/git-interface prior to 2.1.2. If both the git remote and destination directory are provided by user input, then the use of an --upload-pack command-line argument feature of git is also supported for git clone, which would then allow for any operating system command to be spawned by the attacker.

From the GitHub Advisory Database (GHSA-qffw-8wg7-h665, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

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

Root cause

Likely, user-controlled input for the git remote and destination was passed to the git clone command without sanitisation, allowing the --upload-pack option to be injected.

Impact

An attacker could spawn any operating system command on the machine running git-interface, leading to full command execution.

What the attacker needed

Attacker controls git remote and destination input; victim runs git-interface with attacker input

The fix

The vulnerability was fixed in version 2.1.2; the tool should validate or escape user-supplied remote and destination values before passing them to git.

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.

This tool lets you clone git repositories by giving it a remote address and a folder name. Because it passed those values directly to git without checking them, someone could sneak in a special git option that makes git run a command of their choosing on the computer. That means an attacker could do anything the tool's user could do.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.