Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2017-5941 PoC — Joyent Node.js 代码问题漏洞

Source
Associated Vulnerability
Title:Joyent Node.js 代码问题漏洞 (CVE-2017-5941)
Description:Joyent Node.js是美国Joyent公司的一套建立在Google V8 JavaScript引擎之上的网络应用平台。该平台主要用于构建高度可伸缩的应用程序,以及编写能够处理数万条且同时连接到一个物理机的连接代码。 Joyent Node.js中的node-serialize模块的unserialize()函数存在代码问题漏洞,该漏洞源于该函数未对外部调用的代码进行有效检测。远程攻击者可通过将恶意数据传入该函数利用该漏洞执行任意代码。
Readme
# CVE-2017-5941 — node-serialize Untrusted Deserialization (RCE) PoC

> ⚠️ For **lab / self-assessment** only. Use **only on systems you own or are authorized to test**.

This repository provides:

- A minimal PoC script to reproduce **CVE-2017-5941** against a vulnerable Node.js app that uses `node-serialize <= 0.0.4`.
- Two vectors:
  - **POST** `/api/deserialize` (default)
  - **Cookie** `profile` for `/profile` (Base64-encoded; server must decode before `unserialize()`)

## What is CVE-2017-5941?

- **Component:** `node-serialize` (≤ 0.0.4)
- **Weakness:** Untrusted deserialization (CWE-502)
- **Behavior:** During `unserialize()`, any string value that begins with `"_$$ND_FUNC$$_"` is treated as executable JavaScript (evaluated).
- **Impact:** If untrusted input reaches `unserialize()`, it leads to **Remote Code Execution**.

Example of a malicious value:

```json
{ "p": "_$$ND_FUNC$$_function(){ require('child_process').exec('id') }()" }
```
File Snapshot

[4.0K] /data/pocs/75a49413c1be85d0dc0c2dda0e440251725fba5a ├── [4.0K] app │   ├── [ 193] Dockerfile │   ├── [ 360] package.json │   ├── [ 29K] package-lock.json │   └── [2.0K] server.js ├── [ 304] docker-compose.yml ├── [4.4K] poc_cve_2017_5941.py └── [ 969] README.md 1 directory, 7 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.