{"answers":{"affected":"2 open source packages ship an affected version, including mermaid.","exploited":"There is no known exploitation of GHSA-m4gq-x24j-jpmf in the wild and no public exploit code.","fix":"Upgrade mermaid to 10.9.3 or later.","what":"GHSA-m4gq-x24j-jpmf is a cross-site scripting vulnerability in mermaid, published on 22 Oct 2024. 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 GHSA-m4gq-x24j-jpmf and fix it if it is affected.\n\nWhat it is: GHSA-m4gq-x24j-jpmf is a cross-site scripting vulnerability in mermaid, published on 22 Oct 2024. 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 GHSA-m4gq-x24j-jpmf in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- mermaid (npm): affected all versions; fixed in 10.9.3\n- mermaid (npm): affected all versions; fixed in 10.9.3\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/GHSA-m4gq-x24j-jpmf/ (Markdown: https://insights.sbomify.com/GHSA-m4gq-x24j-jpmf/index.md)","id":"GHSA-m4gq-x24j-jpmf","markdown":"https://insights.sbomify.com/GHSA-m4gq-x24j-jpmf/index.md","name":"GHSA-m4gq-x24j-jpmf","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":true,"product_category":"JavaScript diagramming library","requires_auth":"none","summary":"Attackers can execute arbitrary JavaScript via XSS in Mermaid diagrams when using specific bundled distribution files.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"The following bundled files within the Mermaid NPM package contain a bundled version of DOMPurify that is vulnerable to https://github.com/cure53/DOMPurify/security/advisories/GHSA-mmhx-hmjr-r674, potentially resulting in an XSS attack.\n\nThis affects the built:\n\n- `dist/mermaid.min.js`\n- `dist/mermaid.js`\n- `dist/mermaid.esm.mjs`\n- `dist/mermaid.esm.min.mjs`\n\nThis will also affect users that use the above files via a CDN link, e.g. `https://cdn.jsdelivr.net/npm/mermaid@10.9.2/dist/mermaid.min.js`\n\n**Users that use the default NPM export of `mermaid`, e.g. `import mermaid from 'mermaid'`, or the `dist/mermaid.core.mjs` file, do not use this bundled version of DOMPurify, and can easily update using their package manager with something like `npm audit fix`.**\n\n### Patches\n\n- `develop` branch: 6c785c93166c151d27d328ddf68a13d9d65adc00\n- backport to v10: 92a07ffe40aab2769dd1c3431b4eb5beac282b34","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Prototype pollution vulnerability found in Mermaid's bundled version of DOMPurify","id":"GHSA-m4gq-x24j-jpmf","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"xss","year":"2024"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["10.9.3"],"introduced":["0"],"last_affected":[],"package":"mermaid","purl":null,"source":"GHSA-m4gq-x24j-jpmf"},{"ecosystem":"npm","fixed":["10.9.3"],"introduced":["0"],"last_affected":[],"package":"mermaid","purl":"pkg:npm/mermaid","source":"GHSA-m4gq-x24j-jpmf"}],"products":null,"published":"2024-10-22","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can execute arbitrary JavaScript via XSS in Mermaid diagrams when using specific bundled distribution files.","url":"https://insights.sbomify.com/GHSA-m4gq-x24j-jpmf/"}