CVE-2020-7597: codecov NPM module command injection via gcov-root

CVE-2020-7597 · Severity: low · CVSS 3.1 · Published 2020-02-19

The codecov NPM module is a utility used by development teams to upload code coverage reports to the Codecov service. A command injection vulnerability in the gcov-root argument handler allows authenticated attackers with local access to the build system to execute arbitrary commands with the privileges of the build process, potentially compromising CI/CD pipelines and introducing malicious code into production.

Technologies: codecov (npm). Vendors: npm.

Quick answers

Is CVE-2020-7597 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2020-7597 being exploited in the wild.
How severe is CVE-2020-7597?
Low severity, with a CVSS score of 3.1, published 19 February 2020.
Which products and versions are affected?
codecov (npm) SEMVER:introduced=0,fixed=3.6.5.
Is there a fix for CVE-2020-7597?
Yes. codecov (npm): upgrade to 3.6.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2020-7597 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2020-7597?
Check whether you run codecov (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • codecov (npm): upgrade to 3.6.5 or later
    npm install codecov@3.6.5

Technical details

The codecov-node NPM module (versions before 3.6.5) contains a command injection vulnerability in lib/codecov.js where the gcov-root argument value is passed unsanitized to the exec function. An attacker can inject arbitrary shell commands by including shell metacharacters (e.g., "& touch exploit &") in the gcov-root parameter. The vulnerability requires authentication (a user must call the vulnerable function) but the attack vector is network-accessible as it can be exploited through module usage in CI/CD systems. This is an incomplete fix of CVE-2020-7596. The fix in version 3.6.5 properly escapes arguments before execution.

Affected products

  • codecov codecov before 3.6.5

Identifiers

  • CVE-2020-7597
  • GHSA-5q88-cjfq-g2mh

Timeline

  • 2020-02-16: disclosed
  • 2020-02-19: advisory
  • 2020-02-19: patched: version 3.6.5 released

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.