CVE-2021-26543: Command injection in git-parse

git-parse Updated 02 Oct 2025

Summary

10/02/2022
Yes i
High
8.8

CVE-2021-26543: Command injection in git-parse. Affects git-parse versions < 1.0.5. Fixed in 1.0.5. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The git-parse package is an npm package used for parsing and manipulating Git repositories. It provides various functions and utilities for interacting with Git repositories programmatically. The vulnerable version of git-parse is <=1.0.4. This package is commonly used by developers who work with Git repositories and may unknowingly introduce the vulnerability into their code.

Vulnerability Detail

The git-parse package, specifically the "gitDiff" function, is susceptible to a command injection vulnerability. This vulnerability allows an attacker to execute arbitrary commands on the host system by manipulating the input to the gitDiff function. As a result, an attacker can potentially gain unauthorized access, modify files, or execute malicious code on the system. This vulnerability has a CVSS score of 8.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

How To Fix

Minimum fixed version

1.0.5

This is the first release that contains the fix.

npm install git-parse@1.0.5

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

Workaround

There is no known workaround for this vulnerability. It is essential to update to the fixed version of git-parse to mitigate the risk.

Conclusion

The git-parse package, specifically the "gitDiff" function, is vulnerable to command injection. This vulnerability can be mitigated by updating to version 1.0.5 or later of the git-parse package. It is crucial for developers to promptly update their projects to ensure the security of their Git repositories. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for git-parse →

Share this vulnerability

FAQ

git-parse is an npm package used for parsing and manipulating Git repositories programmatically.

This vulnerability allows an attacker to execute arbitrary commands on the host system, potentially leading to unauthorized access, file modification, or execution of malicious code.

To fix this vulnerability, update the git-parse package to version 1.0.5 or later.

No, there is no known workaround. Updating to the fixed version is the recommended solution.

The CVSS score of this vulnerability is 8.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

How To Fix

Minimum fixed version

1.0.5

This is the first release that contains the fix.

npm install git-parse@1.0.5

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