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


0.0
critical

Snyk CVSS

    Attack Complexity Low
    Confidentiality High
    Integrity High
    Availability High

    Threat Intelligence

    Exploit Maturity Mature
    EPSS 1.04% (84th percentile)
Expand this section
NVD
9.8 critical

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 npm:serialize-to-js:20170208
  • published 13 Feb 2017
  • disclosed 8 Feb 2017
  • credit Ajin Abraham

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);