CVE-2017-5954
Code Execution Through IIFE in serialize-to-js
An issue was discovered in the serialize-to-js package 0.5.0 for Node.js. Untrusted data passed into the deserialize() function can be exploited to achieve arbitrary code execution by passing a JavaScript Object with an Immediately Invoked Function Expression (IIFE).
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
An issue was discovered in the serialize-to-js package 0.5.0 for Node.js. Untrusted data passed into the deserialize() function can be exploited to achieve arbitrary code execution by passing a JavaScript Object with an Immediately Invoked Function Expression (IIFE).
- Record
CVE-2017-5954- CVSS 3.0
- 9.8 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-502
- Updated
- 2026-11-02
CVE List No score
An issue was discovered in the serialize-to-js package 0.5.0 for Node.js. Untrusted data passed into the deserialize() function can be exploited to achieve arbitrary code execution by passing a JavaScript Object with an Immediately Invoked Function Expression (IIFE).
- Record
CVE-2017-5954- Updated
- 2026-11-02
EUVDEUVD-2018-0297 No score
An issue was discovered in the serialize-to-js package 0.5.0 for Node.js. Untrusted data passed into the deserialize() function can be exploited to achieve arbitrary code execution by passing a JavaScript Object with an Immediately Invoked Function Expression (IIFE).
- Record
EUVD-2018-0297- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-mm62-wxc8-cf7m
9.8
Code Execution Through IIFE in serialize-to-js
Affected versions of serialize-to-js may be vulnerable to arbitrary code execution through an Immediately Invoked Function Expression (IIFE).
Proof of Concept
var payload = "{e: (function(){ eval('console.log(`exploited`)') })() }"
var serialize = require('serialize-to-js');
serialize.deserialize(payload);
Recommendation
Update to version 1.0.0, or later, and review this disclaimer from the author.
- Record
GHSA-mm62-wxc8-cf7m- CVSS 3.0
- 9.8 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-502
- Updated
- 2026-11-02
OSV
9.8
An issue was discovered in the serialize-to-js package 0.5.0 for Node.js. Untrusted data passed into the deserialize() function can be exploited to achieve arbitrary code execution by passing a JavaScript Object with an Immediately Invoked Function Expression (IIFE).
- Record
CVE-2017-5954- CVSS 3.0
- 9.8 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVGHSA-mm62-wxc8-cf7m
9.8
Code Execution Through IIFE in serialize-to-js
Affected versions of serialize-to-js may be vulnerable to arbitrary code execution through an Immediately Invoked Function Expression (IIFE).
Proof of Concept
var payload = "{e: (function(){ eval('console.log(`exploited`)') })() }"
var serialize = require('serialize-to-js');
serialize.deserialize(payload);
Recommendation
Update to version 1.0.0, or later, and review this disclaimer from the author.
- Record
GHSA-mm62-wxc8-cf7m- CVSS 3.0
- 9.8 Critical
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-502
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
serialize-to-jsnpm |
before 1.0.0 | 1.0.0 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2017-5954 is a critical vulnerability (CVSS 9.8) in Serialize-to-js Project Serialize-to-js, published February 10, 2017. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 4.46%, the 91st percentile. Fixed in serialize-to-js 1.0.0.
References
opsecx.com/index.php/2017/02/08/exploiting-node-js-deserialization-bug-for-remote-code-execution
github.com/commenthol/serialize-to-js/issues/1
securityfocus.com/bid/96223
nvd.nist.gov/vuln/detail/CVE-2017-5954
github.com/advisories/GHSA-mm62-wxc8-cf7m
npmjs.com/advisories/313
npmjs.com/package/serialize-to-js
github.com/commenthol/serialize-to-js/commit/1cd433960e5b9db4c0b537afb28366198a319429
github.com/commenthol/serialize-to-js