node-import@0.3.0 vulnerabilities

Imports dependencies and run it directly or concatenate them and exports to file.

Direct Vulnerabilities

Known vulnerabilities in the node-import package. This does not include vulnerabilities belonging to this package’s dependencies.

Automatically find and fix vulnerabilities affecting your projects. Snyk scans for vulnerabilities and provides fixes for free.
Fix for free
Vulnerability Vulnerable Version
  • H
Arbitrary Code Execution

node-import is a package that imports dependencies and run it directly or concatenate them and exports to file.

Affected versions of this package are vulnerable to Arbitrary Code Execution. The "params" argument of module function can be controlled by users without any sanitization.b. This is then provided to the “eval” function located in line 79 in the index file "index.js".

PoC

var a = require("node-import");
var params = {
  'fs=require("fs");fs.writeFile("JHU");//':123
}
a.module('',params,true)

How to fix Arbitrary Code Execution?

There is no fixed version for node-import.

*