Vulnerabilities in pkg:npm/git-tags-remote

PACKAGE
Advisory Summary

GHSA-gm9x-q798-hmr4 is a HIGH (CVSS 7.2) command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Git tags remote libraries in the npm ecosystem. The issue involves command injection in git-tags-remote. Remediation is available by upgrading affected packages to version 1.0.4.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/git-tags-remote

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/git-tags-remote. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-gm9x-q798-hmr4 - HIGH Command Injection in git-tags-remote

GHSA-gm9x-q798-hmr4 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-gm9x-q798-hmr4
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Git tags remote
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-gm9x-q798-hmr4

To remediate this vulnerability, upgrade all affected Git tags remote dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

git-tags-remote fixed: 1.0.4
npm install git-tags-remote@1.0.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls git-tags-remote

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-gm9x-q798-hmr4, inspect your project dependencies using npm:

npm ls git-tags-remote

Analyze the terminal output to locate any version of Git tags remote in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.4), your application is affected.

Note: The npm ls git-tags-remote command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Git tags remote, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

All versions of `git-tags-remote ` are vulnerable to Command Injection. The package fails to sanitize the repository input and passes it directly to an `exec` call on the `get` function . This may allow attackers to execute arbitrary code in the system if the `repo` value passed to the function is user-controlled. The following proof-of-concept creates a file in `/tmp`: ``` const gitTagsRemote = require('git-tags-remote'); gitTagsRemote.get('https://github.com/sh0ji/git-tags-remote.git; echo "Injection Success" > /tmp/command-injection.test') .then(tags => console.log(tags)); ```

GHSA-gm9x-q798-hmr4 Affected Git tags remote Versions

1 component(s)
Fixed Versions:
1.0.4
Product / Package Ecosystem Affected Versions Fixed Version
git-tags-remote
npm
< 1.0.4
1.0.4

References

Frequently Asked Questions

What is GHSA-gm9x-q798-hmr4?
GHSA-gm9x-q798-hmr4 is a security vulnerability in Git tags remote involving Command Injection in git-tags-remote under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Git tags remote versions are affected?
Affected versions include releases prior to 1.0.4 across affected packages: git-tags-remote.
What version fixes GHSA-gm9x-q798-hmr4?
Upgrading to 1.0.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is git-tags-remote affected?
Yes, git-tags-remote is affected in releases prior to 1.0.4. Upgrade your dependency to 1.0.4 or later.
What is the CVSS score of GHSA-gm9x-q798-hmr4?
GHSA-gm9x-q798-hmr4 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with GHSA-gm9x-q798-hmr4?
GHSA-gm9x-q798-hmr4 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for GHSA-gm9x-q798-hmr4?
Run the dependency tree command: 'npm ls git-tags-remote'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gm9x-q798-hmr4",
  "modified" : "2021-09-23T17:26:33Z",
  "published" : "2020-07-29T14:53:40Z",
  "aliases" : [ ],
  "summary" : "Command Injection in git-tags-remote",
  "details" : "All versions of `git-tags-remote ` are vulnerable to Command Injection. The package fails to sanitize the repository input and passes it directly to an `exec` call on the `get` function . This may allow attackers to execute arbitrary code in the system if the `repo` value passed to the function is user-controlled.  \n\nThe following proof-of-concept creates a file in `/tmp`:  \n```\nconst gitTagsRemote = require('git-tags-remote');\n\ngitTagsRemote.get('https://github.com/sh0ji/git-tags-remote.git; echo \"Injection Success\" > /tmp/command-injection.test')\n.then(tags => console.log(tags));\n```",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "git-tags-remote"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.4"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sh0ji/git-tags-remote/issues/58"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sh0ji/git-tags-remote/commit/a20488960cbd2c98455386108253094897ebfc1c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sh0ji/git-tags-remote"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1517"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-07-29T14:52:24Z",
    "nvd_published_at" : null
  }
}