Command Injection in marsdb

marsdb Updated 02 Oct 2025

Summary

03/09/2020
CRITICAL
No i
Critical
Not published

GHSA-5mrr-rgp6-x4gr: Command Injection in marsdb. Affects marsdb versions >= 0.0.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The marsdb package is an open-source npm package used for database operations. It provides functionality for querying and manipulating data in a MongoDB-like manner. However, all versions of marsdb are vulnerable to Command Injection.

Vulnerability Detail

The vulnerability exists in the DocumentMatcher class of marsdb, where selectors on $where clauses are passed to a Function constructor without proper sanitization. This allows attackers to inject and execute arbitrary commands in the system when the function is executed. The impact of this vulnerability can be severe, as it enables unauthorized execution of commands on the system where the package is being used.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As there is no official fix, a possible workaround is to implement strict input validation and sanitization when using the affected functionality of marsdb. This can help mitigate the risk of command injection attacks. Here's an example of how input validation can be done in JavaScript:

const userInput = req.body.selector;
const sanitizedInput = userInput.replace(/[&|;$%@"<>()+,]/g, '');
// Use the sanitized input in the `$where` clause

Conclusion

The marsdb package is vulnerable to Command Injection, allowing attackers to execute arbitrary commands on the system. Currently, no fix is available, and it is recommended to use an alternative package. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for marsdb →

Share this vulnerability

FAQ

marsdb is an npm package used for database operations, providing MongoDB-like functionality.

Command Injection is a security vulnerability where an attacker can execute arbitrary commands on a system by injecting malicious input into a command execution function.

The vulnerability allows attackers to execute arbitrary commands on the system where marsdb is being used. This can lead to unauthorized access, data manipulation, or even complete system compromise.

Currently, there is no fix available for this vulnerability in marsdb. It is recommended to use an alternative package until a fix is released.

To mitigate the risk, implement strict input validation and sanitization when using the affected functionality of marsdb. Additionally, consider using an alternative package until a fix is available.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback