GitHub Advisoryadvisory · npm

GHSA-gm9x-q798-hmr4 Command Injection in git-tags-remote

HIGH Published 2020-07-29 Modified 2021-09-23 Official page ↗
Ecosystem
npm
Packages
git-tags-remote
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Weaknesses
CWE-78
Reviewed
2020-07-29

Affected packages

• npm git-tags-remote: < 1.0.4 → fixed in 1.0.4

Description

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)); ```

Related

Weakness · CWE (1)

  • CWE-78 Improper Neutralization of Special Elements used in an OS Command weakness

References