Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWh4d20teDU1My14MzU5

Arbitrary Command Injection due to Improper Command Sanitization

Summary

There exists a command injection vulnerability in npmcli/git versions <2.0.8 which may result in arbitrary shell command execution due to improper argument sanitization when npmcli/git is used to execute Git commands based on user controlled input.

The impact of this issue is possible Arbitrary Command Injection when npmcli/git is run with untrusted (user controlled) Git command arguments.

Impact

Arbitrary Command Injection

Details

npmcli/git prior to release 2.0.8 passed user controlled input as arguments to a shell command without properly sanitizing this input. Passing unsanitized input to a shell can lead to arbitrary command injection. For example passing git+https://github.com/npm/git; echo hello world would trigger the shell execution of echo hello world.

This issue was remediated by no longer running npmcli/git git commands through an intermediate shell.

Patches

This issue has been patched in release 2.0.8

Acknowledgements

This report was reported to us by @tyage (Ierae Security) through the GitHub Bug Bounty Program.

Permalink: https://github.com/advisories/GHSA-hxwm-x553-x359
JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLWh4d20teDU1My14MzU5
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: almost 3 years ago
Updated: over 1 year ago


Identifiers: GHSA-hxwm-x553-x359
References: Repository: https://github.com/npm/git
Blast Radius: 0.0

Affected Packages

npm:@npmcli/git
Dependent packages: 10
Dependent repositories: 261,470
Downloads: 30,179,509 last month
Affected Version Ranges: < 2.0.8
Fixed in: 2.0.8
All affected versions: 1.0.0, 1.0.1, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.0.6, 2.0.7
All unaffected versions: 2.0.8, 2.0.9, 2.1.0, 3.0.0, 3.0.1, 3.0.2, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.1.0, 5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7