Arbitrary Code Execution Affecting serialize-to-js package, versions <1.0.0


Severity

Recommended
0.0
critical
0
10

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

Threat Intelligence

Exploit Maturity
Mature
EPSS
0.54% (78th 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 IDnpm:serialize-to-js:20170208
  • published13 Feb 2017
  • disclosed8 Feb 2017
  • creditAjin Abraham

Introduced: 8 Feb 2017

CVE-2017-5954  (opens in a new tab)
CWE-502  (opens in a new tab)

How to fix?

Upgrade serialize-to-js to version 1.0.0 or higher.

Overview

serialize-to-js serializes objects to javascript.

Affected versions of this package are vulnerable to Arbitrary Code Execution. If untrusted user-input is passed into the deserialize(), attackers will be able to send a serialized JavaScript Objects with an Immediately Invoked Function Expression (IIFE).

Example:

var serialize = require('serialize-to-js');
var payload = '{"rce":"_$$ND_FUNC$$_function (){require(\'child_process\').exec(\'ls /\', function(error, stdout, stderr) { console.log(stdout) });}()"}';
serialize.deserialize(payload);

CVSS Scores

version 3.1