CVE-2022-4687: Malicious code in mongoos (npm)

mongoos Updated 02 Oct 2025

Summary

19/08/2022
CRITICAL
No i
Critical
Not published

MAL-2022-4687: Malicious code in mongoos (npm). Affected versions are not published. 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 Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Mongoos is an npm package used for interacting with MongoDB databases. It provides an object modeling tool for Node.js, allowing developers to define schemas and perform CRUD operations on MongoDB collections. The package is widely used in Node.js applications for database management and data manipulation. However, the package has been found to contain malicious code, posing a significant security risk to any computer that has it installed or running.

Vulnerability Detail

The vulnerability, identified as CVE-2022-4687, originates from the presence of malicious code within the mongoos npm package. This code compromises the security of any computer running the package, potentially granting full control to an external entity. As a result, all secrets and keys stored on the affected computer should be rotated immediately from a different computer. Removing the package may not guarantee the removal of all malicious software installed as a consequence of its installation. The presence of this vulnerability exposes sensitive information and can lead to unauthorized access and data breaches.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall mongoos

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

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

Workaround

There is no known workaround for this vulnerability. It is imperative to follow the steps outlined in the 'how_to_fix' section to address the issue effectively.

Conclusion

The presence of malicious code in the mongoos npm package poses a significant security risk to any computer running it. It is essential to take immediate action by rotating secrets and keys, removing the package, and conducting a thorough security audit. Implementing additional security measures can help mitigate the risk of future attacks. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for mongoos →

Share this vulnerability

FAQ

Mongoos is an npm package used for object modeling in Node.js applications, specifically for interacting with MongoDB databases.

The presence of this vulnerability allows an external entity to gain full control of the affected computer, potentially leading to unauthorized access, data breaches, and exposure of sensitive information.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using package-lock.json without requiring access to the code or installation.

If your computer is affected, it is crucial to rotate all secrets and keys stored on the affected computer from a different, trusted computer. Remove the mongoos package and conduct a thorough security audit to identify any potential compromise or unauthorized access.

In addition to addressing the immediate vulnerability, it is recommended to implement network segmentation and access controls to mitigate the risk of future attacks.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall mongoos

If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.

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