CVE-2017-5941
Code Execution through IIFE in node-serialize
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Untrusted data passed into the unserialize() 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 node-serialize package 0.0.4 for Node.js. Untrusted data passed into the unserialize() function can be exploited to achieve arbitrary code execution by passing a JavaScript Object with an Immediately Invoked Function Expression (IIFE).
- Record
CVE-2017-5941- CVSS 3.1
- 9.8 Critical
CVSS:3.1/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 node-serialize package 0.0.4 for Node.js. Untrusted data passed into the unserialize() function can be exploited to achieve arbitrary code execution by passing a JavaScript Object with an Immediately Invoked Function Expression (IIFE).
- Record
CVE-2017-5941- Updated
- 2026-11-02
EUVDEUVD-2018-0309 No score
An issue was discovered in the node-serialize package 0.0.4 for Node.js. Untrusted data passed into the unserialize() function can be exploited to achieve arbitrary code execution by passing a JavaScript Object with an Immediately Invoked Function Expression (IIFE).
- Record
EUVD-2018-0309- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-q4v7-4rhw-9hqm
9.8
Code Execution through IIFE in node-serialize
Affected versions of node-serialize can be abused to execute arbitrary code via an immediately invoked function expression (IIFE) if untrusted user input is passed into unserialize().
Recommendation
There is no direct patch for this issue. The package author has reviewed this advisory, and provided the following recommendation:
To avoid the security issues, at least one of the following methods should be taken:
1. Make sure to send serialized strings internally, isolating them from potential hackers. For example, only sending the strings from backend to fronend and always using HTTPS instead of HTTP.
2. Introduce public-key cryptosystems (e.g. RSA) to ensure the strings not being tampered with.
- Record
GHSA-q4v7-4rhw-9hqm- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-502
- Updated
- 2026-11-02
OSVGHSA-q4v7-4rhw-9hqm
9.8
Code Execution through IIFE in node-serialize
Affected versions of node-serialize can be abused to execute arbitrary code via an immediately invoked function expression (IIFE) if untrusted user input is passed into unserialize().
Recommendation
There is no direct patch for this issue. The package author has reviewed this advisory, and provided the following recommendation:
To avoid the security issues, at least one of the following methods should be taken:
1. Make sure to send serialized strings internally, isolating them from potential hackers. For example, only sending the strings from backend to fronend and always using HTTPS instead of HTTP.
2. Introduce public-key cryptosystems (e.g. RSA) to ensure the strings not being tampered with.
- Record
GHSA-q4v7-4rhw-9hqm- CVSS 3.1
- 9.8 Critical
CVSS:3.1/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 |
|---|---|---|
node-serializenpm |
through 0.0.4 | None known |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| Exploit-DB | Node.JS - 'node-serialize' Remote Code Execution | 2017-02-08 |
| Exploit-DB | Node.JS - 'node-serialize' Remote Code Execution (2) | 2021-02-10 |
| Exploit-DB | Node.JS - 'node-serialize' Remote Code Execution (3) | 2021-06-18 |
| PoC in GitHub | Cr4zyD14m0nd137/Lab-for-cve-2018-15133 | 2023-05-10 |
| PoC in GitHub | Frivolous-scholar/CVE-2017-5941-NodeJS-RCE | 2020-11-10 |
| PoC in GitHub | f41k0n/RCE-NodeJs | 2025-10-12 |
| PoC in GitHub | jimahub/scenario-c-block | 2026-09-28 |
| PoC in GitHub | kylew1004/cve-2017-5941-poc-docker-lab | 2025-08-10 |
| PoC in GitHub | turnernator1/Node.js-CVE-2017-5941 | 2023-03-30 |
| PoC in GitHub | uartu0/nodejshell | 2023-08-18 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, Exploit-DB, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2017-5941 is a critical vulnerability (CVSS 9.8) in Node-serialize Project Node-serialize, published February 9, 2017. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 61.3%, the 99th percentile. No source names a fixed version.
References
nodesecurity.io/advisories/311
opsecx.com/index.php/2017/02/08/exploiting-node-js-deserialization-bug-for-remote-code-execution
securityfocus.com/bid/96225
packetstormsecurity.com/files/161356/Node.JS-Remote-Code-Execution.html
packetstormsecurity.com/files/163222/Node.JS-Remote-Code-Execution.html
nvd.nist.gov/vuln/detail/CVE-2017-5941
github.com/luin/serialize/issues/4
github.com/advisories/GHSA-q4v7-4rhw-9hqm
npmjs.com/advisories/311