{"id":"GHSA-m4gq-x24j-jpmf","aliases":[],"status":"published","title":"Prototype pollution vulnerability found in Mermaid's bundled version of DOMPurify","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","severity":{"version":"3.1","score":7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:L","level":"high","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-1321","CWE-1395"],"published":"2024-10-22T18:17:02Z","modified":"2024-10-23T16:58:48Z","fixes":[{"ecosystem":"npm","package":"mermaid","fixed_in":["10.9.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"mermaid","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"10.9.2"},{"fixed":"10.9.3"}]}]},{"source":"osv","ecosystem":"npm","package":"mermaid","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"10.9.3"}]}]}],"references":[{"url":"https://github.com/cure53/DOMPurify/security/advisories/GHSA-mmhx-hmjr-r674","tags":["web"]},{"url":"https://github.com/mermaid-js/mermaid/security/advisories/GHSA-m4gq-x24j-jpmf","tags":["web"]},{"url":"https://github.com/mermaid-js/mermaid/commit/6c785c93166c151d27d328ddf68a13d9d65adc00","tags":["web"]},{"url":"https://github.com/mermaid-js/mermaid/commit/92a07ffe40aab2769dd1c3431b4eb5beac282b34","tags":["web"]},{"url":"https://github.com/advisories/GHSA-m4gq-x24j-jpmf"},{"url":"https://github.com/mermaid-js/mermaid","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-m4gq-x24j-jpmf","title":"Prototype pollution vulnerability found in Mermaid's bundled version of DOMPurify","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","status":"published","published":"2024-10-22T18:17:02Z","modified":"2024-10-23T16:58:48Z","cvss":[{"version":"3.1","score":7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:L","level":"high"}],"cwes":["CWE-1321","CWE-1395"],"updated_at":"2026-11-02T14:38:13.09489Z"}],"osv":[{"id":"GHSA-m4gq-x24j-jpmf","title":"Prototype pollution vulnerability found in Mermaid's bundled version of DOMPurify","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","status":"published","published":"2024-10-22T18:17:02Z","modified":"2024-10-23T14:24:24Z","cvss":[{"version":"3.1","score":7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:L","level":"high"}],"cwes":["CWE-1321","CWE-1395"],"updated_at":"2026-11-02T15:46:51.463834Z"}]}}
