Command Injection Affecting pulverizr package, versions *


0.0
medium

Snyk CVSS

    Attack Complexity High
    Confidentiality High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 1.23% (86th percentile)
Expand this section
NVD
9.8 critical

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 ID SNYK-JS-PULVERIZR-560122
  • published 13 Mar 2020
  • disclosed 13 Mar 2020
  • credit JHU System Security Lab

How to fix?

There is no fixed version for pulverizr.

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();

References