CVE-2019-10758: Mongo express Remote Code Execution Vulnerability

CRITICAL
Advisory Identifier: GHSA-h47j-hc6x-h3qq
CVSS 9.9
CWE-78 CWE-94
Published
Advisory Summary

CVE-2019-10758 is a CRITICAL (CVSS 9.9) remote code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Mongo express libraries in the npm ecosystem. The issue involves remote code execution vulnerability in npm mongo-express. Remediation is available by upgrading affected packages to version 0.54.0.

CVE-2019-10758 at a Glance

CVE Identifier CVE-2019-10758
GHSA Identifier GHSA-h47j-hc6x-h3qq
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product Mongo express
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2019-10758

To remediate this vulnerability, upgrade all affected Mongo express dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mongo-express fixed: 0.54.0
npm install mongo-express@0.54.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mongo-express

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2019-10758, inspect your project dependencies using npm:

npm ls mongo-express

Analyze the terminal output to locate any version of Mongo express in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.54.0), your application is affected.

Note: The npm ls mongo-express command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Mongo express, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Remote code execution on the host machine by any authenticated user. ### Proof Of Concept Launching mongo-express on a Mac, pasting the following into the "create index" field will pop open the Mac calculator: ```javascript this.constructor.constructor("return process")().mainModule.require('child_process').execSync('/Applications/Calculator.app/Contents/MacOS/Calculator') ``` ### Patches Users should upgrade to version `0.54.0` ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ ### For more information If you have any questions or comments about this advisory: * Open an issue in [example link to repo](http://example.com) * Email us at [example email address](mailto:example@example.com) #### Thanks @JLLeitschuh for finding and reporting this vulnerability This vulnerability has been [exploited](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2019-10758) in the wild.

CVE-2019-10758 Affected Mongo express Versions

1 component(s)
Fixed Versions:
0.54.0
Product / Package Ecosystem Affected Versions Fixed Version
mongo-express
npm
< 0.54.0
0.54.0

References

Frequently Asked Questions

What is CVE-2019-10758?
CVE-2019-10758 is a security vulnerability in Mongo express involving Remote Code Execution Vulnerability in NPM mongo-express under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which Mongo express versions are affected?
Affected versions include releases prior to 0.54.0 across affected packages: mongo-express.
What version fixes CVE-2019-10758?
Upgrading to 0.54.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mongo-express affected?
Yes, mongo-express is affected in releases prior to 0.54.0. Upgrade your dependency to 0.54.0 or later.
What is the CVSS score of CVE-2019-10758?
CVE-2019-10758 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:H.
What CWE is associated with CVE-2019-10758?
CVE-2019-10758 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2019-10758?
Run the dependency tree command: 'npm ls mongo-express'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h47j-hc6x-h3qq",
  "modified" : "2025-10-22T17:44:59Z",
  "published" : "2019-12-30T19:30:31Z",
  "aliases" : [ "CVE-2019-10758" ],
  "summary" : "Remote Code Execution Vulnerability in NPM mongo-express",
  "details" : "### Impact\n\nRemote code execution on the host machine by any authenticated user.\n\n### Proof Of Concept\n\nLaunching mongo-express on a Mac, pasting the following into the \"create index\" field will pop open the Mac calculator:\n\n```javascript\nthis.constructor.constructor(\"return process\")().mainModule.require('child_process').execSync('/Applications/Calculator.app/Contents/MacOS/Calculator')\n```\n\n### Patches\nUsers should upgrade to version `0.54.0`\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [example link to repo](http://example.com)\n* Email us at [example email address](mailto:example@example.com)\n\n#### Thanks\n\n@JLLeitschuh for finding and reporting this vulnerability\n\nThis vulnerability has been [exploited](https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2019-10758) in the wild.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H/E:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongo-express"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.54.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/mongo-express/mongo-express/security/advisories/GHSA-h47j-hc6x-h3qq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2019-10758"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongo-express/mongo-express/pull/522"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongo-express/mongo-express/commit/7d365141deadbd38fa961cd835ce68eab5731494"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongo-express/mongo-express/commit/d8c9bda46a204ecba1d35558452685cd0674e6f2"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mongo-express/mongo-express"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongo-express/mongo-express/blob/ea02b364d43f179f191fc91fb9962efdb0843a8d/lib/bson.js#L60"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-MONGOEXPRESS-473215"
  }, {
    "type" : "WEB",
    "url" : "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2019-10758"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2019-12-30T19:29:02Z",
    "nvd_published_at" : "2019-12-24T22:15:11Z"
  }
}