CVE DatabaseCVE-2019-10758
한국어 권고문 →
CVE-2019-107589.9/CRITICALCISA KEVCWE-94

mongo-express Remote Code Execution (RCE) Vulnerability Analysis via vm Module Misuse (CVE-2019-10758)

⚡ Jump to Patch
Affected Vendors
mongo-express
Affected Components
mongo-express
Published Date
2019-12-24
CVSS v3.1
9.9
CRITICAL
EPSS (30d)
84.7%
FIRST.org
CISA KEV
Exploited

Executive & SecOps Summary

SECOPS ASSESSMENT
Affected Scope

All Node.js database management environments running mongo-express versions prior to 0.54.0

Impact

Authenticated attackers can bypass the sandbox and execute arbitrary system commands on the host OS via endpoints utilizing the toBSON method

Mitigation

Immediately upgrade the mongo-express package to version 0.54.0 or higher, restrict external access, and enforce strong authentication

Affected Products & Version Scope

All versions of mongo-express prior to 0.54.0 (Web console application running on Node.js)

Remediation & Live Workaround Commands

PATCH & WORKAROUND

1. Official Patch & Version Upgrade Commands

The primary remediation is to upgrade mongo-express to version 0.54.0 or later. Run the following commands to update your project dependencies:

bash
# For npm users
npm install mongo-express@0.54.0 --save

# For yarn users
yarn upgrade mongo-express@0.54.0

# For Docker environments, pull the patched image
docker pull mongo-express:0.54.0

2. Temporary Workaround & Hardening Configuration

If patching cannot be applied immediately, restrict access to the mongo-express web console. Use an Nginx reverse proxy to limit access to trusted IP ranges only.

nginx
# /etc/nginx/conf.d/mongo-express.conf
server {
    listen 80;
    server_name mongo-express.local;

    location / {
        # Allow only trusted internal administrator IP ranges
        allow 10.0.0.0/8;
        allow 192.168.1.0/24;
        deny all;

        proxy_pass http://127.0.0.1:8081;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}

3. Log Audit & IoC Verification Commands

Verify the currently running version of mongo-express and inspect web server logs for potential exploitation attempts targeting the toBSON method.

bash
# 1. Check the installed mongo-express version
npm list mongo-express

# 2. Check the running container image version
docker ps --filter 'ancestor=mongo-express' --format '{{.ID}}  {{.Image}}'

# 3. Scan access logs for sandbox escape and child_process execution payloads
grep -Ei 'toBSON|constructor|process|exec|child_process' /var/log/nginx/access.log
Interactive SecOps Remediation Checklist
0/4 (0%)
Recommended Security Control & Mitigation Partner
Snyk Open Source & Container Security
As this vulnerability is actively exploited in the wild (CISA KEV), immediately upgrade mongo-express to 0.54.0+ and change default administrative credentials.

Scan Your Repositories for Transitive Vulnerable Dependencies in 30 Seconds

Automatically detect vulnerable packages across npm, PyPI, Maven, and Go, and open automated fix Pull Requests without breaking your build.

Free Forever Tier · 1-Click GitHub/GitLab Auto-PR
Master DevSecOps: Automated SAST/SCA in GitHub Actions & Kubernetes
View Course Curriculum

Technical Root Cause & Exploitation Mechanics

1. Vulnerability Overview & Root Cause

This is a critical Remote Code Execution (RCE) vulnerability in mongo-express, a web-based administrative interface for MongoDB. The root cause lies in the insecure misuse of the Node.js native vm module when processing user-supplied input. mongo-express utilizes the toBSON method internally to convert string inputs into BSON objects. Due to a lack of input validation, executing dynamic code via APIs like vm.runInNewContext allows attackers to escape the sandbox environment and execute malicious JavaScript code within the context of the host process.

2. Exploitation Mechanics & Attack Scenario

An authenticated attacker (often leveraging default credentials like admin:pass if left unchanged) sends a malicious HTTP POST request to specific API endpoints (e.g., /db/<database>/collections/<collection>) that trigger the toBSON method. The request payload contains a prototype chain escape sequence such as this.constructor.constructor('return process')(). This bypasses the vm sandbox, gains access to the host's process object, and invokes the exec function of the child_process module to execute arbitrary OS commands on the target server. This vulnerability has public PoCs and is actively exploited in the wild, leading to its inclusion in the CISA KEV catalog.

3. Infrastructure & Business Impact

With a CVSS 3.1 score of 9.9, this vulnerability poses a critical threat. Successful exploitation grants the attacker full control over the container or host server running the mongo-express process. This can lead to unauthorized access, exfiltration, or destruction of sensitive data stored in the MongoDB database, and allows attackers to establish a foothold for lateral movement within the internal network.

Official Vendor Advisories & References

Frequently Asked SecOps Questions (CVE-2019-10758)

FAQ

Q1. How critical is CVE-2019-10758 and is it actively exploited in the wild?

CVE-2019-10758 is rated CVSS 9.9 (CRITICAL) with a 30-day EPSS exploitation probability of 84.7%. It is listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, requiring immediate emergency remediation.

Q2. Which vendors and products are affected by CVE-2019-10758?

Primary impacted vendors include mongo-express across mongo-express. Scope summary: All versions of mongo-express prior to 0.54.0 (Web console application running on Node.js)

Q3. What temporary mitigations or workarounds exist for CVE-2019-10758 before patching?

[Mitigation] Immediately upgrade the mongo-express package to version 0.54.0 or higher, restrict external access, and enforce strong authentication Follow the CLI remediation commands and interactive SecOps checklist on this page to restrict exposure prior to your maintenance window.

SECOPS WORKBENCH INTEGRATION

Generate an Internal Engineering Notice or CISO Report for CVE-2019-10758

Instantly format this advisory into an executive CISO summary or engineering patch ticket.

Generate Report →

🔗 Related Advisories in Similar Stack (mongo-express)

View Category →
SecOps Advisory Dispatch & RSS Feed

Subscribe to Daily Vulnerability Briefings & KEV Alerts

Concise morning briefings for SecOps, DevSecOps, and SRE teams covering newly exploited CVEs and mitigation priorities.

Slack / Teams / RSS Feed:
PatchKO
CVE-2019-10758 mongo-express Remote Code Execution (RCE) Vulnerability Analysis via vm Module Misuse (CVE-2019-10758) (CVSS 9.9) - Patch & Workaround | CVE Pulse