CVE-2021-21422: Cross-site scripting in mongo-express

mongo-express Updated 02 Oct 2025

Summary

28/06/2021
Yes i
High
8.1

CVE-2021-21422: Cross-site scripting. Affects mongo-express versions < 1.0.0-alpha.4. Fixed in 1.0.0-alpha.4. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Mongo-express is an open-source web-based administrative interface for MongoDB. It provides a user-friendly interface to manage databases, collections, and documents. However, a vulnerability has been discovered in mongo-express that allows for cross-site scripting (XSS) attacks.

Vulnerability Detail

The vulnerability in mongo-express allows for two types of XSS attacks. Firstly, when the content of a cell exceeds the supported size, clicking on a row will display the full unescaped document. This requires admin interaction on the cell. Secondly, data cells identified as media are rendered without being sanitized, allowing for the execution of malicious scripts. An unauthorized user can exploit this vulnerability by sending a large amount of data in a field of a document, which can lead to various attacks such as exporting collections to an attacker-controlled server or dropping databases or collections.

How To Fix

Latest published version: 1.1.0-rc-4 as of 23 Oct 2026

npm install mongo-express@1.1.0-rc-4

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.0.0-alpha.4

This is the first release that contains the fix.

npm install mongo-express@1.0.0-alpha.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to upgrade to the fixed version to mitigate the risk of exploitation.

Conclusion

The vulnerability in mongo-express allows for cross-site scripting attacks, which can lead to unauthorized access, data leakage, and other malicious activities. It is crucial to upgrade to the fixed version of mongo-express to mitigate the risk of exploitation. For further support on vulnerability remediation, contact DevNack.com.

See every vulnerability recorded for mongo-express →

Share this vulnerability

FAQ

Mongo-express is a web-based administrative interface for MongoDB that allows users to manage databases, collections, and documents.

Cross-site scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts into web pages viewed by other users.

An attacker can exploit this vulnerability by sending a large amount of data in a field of a document, which can lead to various attacks such as exporting collections to an attacker-controlled server or dropping databases or collections.

No, there is no known workaround for this vulnerability. It is recommended to upgrade to the fixed version of mongo-express.

To fix this vulnerability, it is recommended to upgrade to version 1.0.0-alpha.4 of mongo-express.

Related vulnerabilities

Recent vulnerabilities recorded for mongo-express.

How To Fix

Latest published version: 1.1.0-rc-4 as of 23 Oct 2026

npm install mongo-express@1.1.0-rc-4

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.0.0-alpha.4

This is the first release that contains the fix.

npm install mongo-express@1.0.0-alpha.4

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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