{"answers":{"affected":"2 open source packages ship an affected version, including mongo-express. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-21422 in the wild and no public exploit code.","fix":"Upgrade mongo-express to 1.0.0-alpha.4 or later.","what":"CVE-2021-21422 is a high-severity cross-site scripting vulnerability in mongo-express, published on 21 Jun 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-21422 and fix it if it is affected.\n\nWhat it is: CVE-2021-21422 is a high-severity cross-site scripting vulnerability in mongo-express, published on 21 Jun 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-21422 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- mongo-express (npm): affected all versions; fixed in 1.0.0-alpha.4\n- mongo-express (npm): affected all versions; fixed in 1.0.0-alpha.4\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-21422/ (Markdown: https://insights.sbomify.com/CVE-2021-21422/index.md)","id":"CVE-2021-21422","markdown":"https://insights.sbomify.com/CVE-2021-21422/index.md","name":"CVE-2021-21422","record":{"aliases":["GHSA-7p8h-86p5-wv3p"],"analysis":{"component_type":"web_application","fix_type":"patch","impacts":["code_execution","data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"MongoDB admin interface","requires_auth":"none","summary":"An attacker can inject JavaScript via large document fields or media cells in mongo-express, potentially stealing data or executing commands when an admin views the content.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"mongo-express","vendor":"mongo-express_project"}],"cvss":{"score":8.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-79","name":"Improper Neutralization of Input During Web Page Generation"}],"description":"mongo-express is a web-based MongoDB admin interface, written with Node.js and express. 1: As mentioned in this issue: 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. 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 a payload with embedded javascript. This could send an export of a collection to the attacker without even an admin knowing. Other types of attacks such as dropping a database\\collection are possible.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"XSS Vulnerability in mongo-express","id":"CVE-2021-21422","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"xss","year":"2021"},"n_packages":2,"n_references":3,"next":{"headline":"Exposure of Version-Control Repository to an Unauthorized Control Sphere in projen","id":"CVE-2021-21423"},"packages":[{"ecosystem":"npm","fixed":["1.0.0-alpha.4"],"introduced":["0"],"last_affected":[],"package":"mongo-express","purl":null,"source":"GHSA-7p8h-86p5-wv3p"},{"ecosystem":"npm","fixed":["1.0.0-alpha.4"],"introduced":["0"],"last_affected":[],"package":"mongo-express","purl":"pkg:npm/mongo-express","source":"GHSA-7p8h-86p5-wv3p"}],"prev":{"headline":"ApiKey secret could be revelated on network issue","id":"CVE-2021-21421"},"products":["mongo-express"],"published":"2021-06-21","related":[{"cvss_score":9.9,"headline":"MongoDB mongo-express Remote Code Execution","id":"CVE-2019-10758","kev_date_added":"2021-12-10","published":"2019-12-24"},{"cvss_score":9.8,"headline":"Remote code execution in mongo-express","id":"CVE-2020-24391","kev_date_added":null,"published":"2021-03-30"},{"cvss_score":6.1,"headline":"mongo-express Cross-site Request Forgery vulnerability","id":"CVE-2023-52555","kev_date_added":null,"published":"2024-03-01"},{"cvss_score":4.4,"headline":"Denial of Service (DoS)","id":"CVE-2021-23372","kev_date_added":null,"published":"2021-04-13"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["mongo-express"]},"summary":"An attacker can inject JavaScript via large document fields or media cells in mongo-express, potentially stealing data or executing commands when an admin views the content.","url":"https://insights.sbomify.com/CVE-2021-21422/"}