CVE-2022-1440: Command injection in git-interface

git-interface Updated 02 Oct 2025

Summary

23/04/2022
Yes i
Critical
9.8

CVE-2022-1440: Command injection in git-interface. Affects git-interface versions < 2.1.2. Fixed in 2.1.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The git-interface package is an npm package used for interacting with Git repositories. It provides a set of functions and utilities to perform various Git operations. The package is widely used in software development projects to manage version control and collaboration. However, prior to version 2.1.2, the package is vulnerable to a command injection attack, which allows an attacker to execute arbitrary operating system commands by manipulating user input during the git clone process.

Vulnerability Detail

The vulnerability (CVE-2022-1440) in git-interface arises from the improper handling of user input when both the git remote and destination directory are provided. This allows an attacker to inject malicious commands into the --upload-pack command-line argument of the git clone operation. By exploiting this vulnerability, an attacker can execute arbitrary commands on the underlying operating system, potentially leading to unauthorized access, data leakage, or remote code execution. The severity of this vulnerability is rated as CRITICAL with a CVSS score of 9.8.

How To Fix

Minimum fixed version

2.1.2

This is the first release that contains the fix.

npm install git-interface@2.1.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If updating the package is not immediately feasible, a temporary workaround can be implemented by validating and sanitizing user input before passing it to the git-interface functions. This can be done by using input validation libraries or implementing custom input sanitization routines. It is crucial to ensure that user input is properly sanitized to prevent command injection attacks.

Conclusion

In conclusion, the git-interface package prior to version 2.1.2 is vulnerable to a command injection attack. This vulnerability allows an attacker to execute arbitrary operating system commands by manipulating user input during the git clone process. To mitigate this risk, it is crucial to update the package to the latest secure version and implement proper input validation and sanitization routines. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for git-interface →

Share this vulnerability

FAQ

This vulnerability allows an attacker to execute arbitrary operating system commands on the underlying system. Depending on the privileges of the user running the vulnerable code, this can lead to unauthorized access, data leakage, or remote code execution.

You can use the Vulert Playground (https://vulert.com/scanner) to check if your application is affected by this vulnerability. Simply upload your package-lock.json file and the Vulert Playground will analyze it for any open-source vulnerabilities, including this specific vulnerability.

At the time of this advisory, there are no known public exploits for this vulnerability. However, it is important to patch the vulnerability as soon as possible to prevent any potential attacks.

The primary mitigation for this vulnerability is to update the git-interface package to version 2.1.2 or later. Additionally, implementing input validation and sanitization routines can help mitigate the risk of command injection attacks.

While git-interface is a popular package for Git operations, there are alternative packages available that can be used as a replacement. Some popular alternatives include nodegit, simple-git, and git-js. It is recommended to evaluate these alternatives based on your specific requirements and choose the one that best fits your needs.

How To Fix

Minimum fixed version

2.1.2

This is the first release that contains the fix.

npm install git-interface@2.1.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback