Command Injection Affecting clamscan package, versions <1.3.0


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
12.68% (96th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-CLAMSCAN-564113
  • published1 Apr 2020
  • disclosed1 Apr 2020
  • creditJHU System Security Lab

Introduced: 1 Apr 2020

CVE-2020-7613  (opens in a new tab)
CWE-79  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade clamscan to version 1.3.0 or higher.

Overview

clamscan is an Use Node JS to scan files on your server with ClamAV's clamscan binary or clamdscan daemon. This is especially useful for scanning uploaded files provided by un-trusted sources.

Affected versions of this package are vulnerable to Command Injection. It is possible to inject arbitrary commands as part of the _is_clamav_binary function located within Index.js.

It should be noted that this vulnerability requires a pre-requisite that a folder should be created with the same command that will be chained to execute. This lowers the risk of this issue.

PoC by Snyk

var Root = require("clamscan");
var fs = require("fs");
var attack_code = "echo vulnerable > create.txt";
var root = new Root();
fs.mkdir(attack_code + "&", function(){});
root.init({"clamscan": {'path': attack_code + "&"}});

CVSS Scores

version 3.1