{"id":"CVE-2021-39199","aliases":["EUVD-2021-2027","GHSA-9q5w-79cv-947m"],"status":"published","title":"Cross site scripting via unsafe defaults in remark-html","description":"remark-html is an open source nodejs library which compiles Markdown to HTML. In affected versions the documentation of remark-html has mentioned that it was safe by default. In practice the default was never safe and had to be opted into. That is, user input was not sanitized. This means arbitrary HTML can be passed through leading to potential XSS attacks. The problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation. On older affected versions, pass `sanitize: true` if you cannot update.","severity":{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.01075,"percentile":0.65427,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-79"],"published":"2021-09-07T18:50:11Z","modified":"2026-10-20T10:54:53Z","fixes":[{"ecosystem":"npm","package":"remark-html","fixed_in":["13.0.2","14.0.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"remark-html","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"13.0.2"}]}]},{"source":"ghsa","ecosystem":"npm","package":"remark-html","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"14.0.0"},{"last_affected":"14.0.0"},{"fixed":"14.0.1"}]}],"versions":["14.0.0"]},{"source":"osv","ecosystem":"npm","package":"remark-html","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"13.0.2"}]}]},{"source":"osv","ecosystem":"npm","package":"remark-html","ranges":[{"type":"SEMVER","events":[{"introduced":"14.0.0"},{"fixed":"14.0.1"}]}],"versions":["14.0.0"]}],"products":[{"vendor":"remark","product":"remark-html"},{"vendor":"remarkjs","product":"remark-html"}],"references":[{"url":"https://github.com/remarkjs/remark-html/security/advisories/GHSA-9q5w-79cv-947m","tags":["x_refsource_CONFIRM","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/remarkjs/remark-html/commit/b75c9dde582ad87ba498e369c033dc8a350478c1","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/remarkjs/remark-html/releases/tag/14.0.1","tags":["x_refsource_MISC","x_transferred","Patch","Release Notes","Third Party Advisory","fix","web"]},{"url":"https://www.npmjs.com/package/remark-html","tags":["x_refsource_MISC","x_transferred","Product","Third Party Advisory","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-39199","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-9q5w-79cv-947m"},{"url":"https://github.com/remarkjs/remark-html","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2021-39199","title":"Cross site scripting via unsafe defaults in remark-html","description":"remark-html is an open source nodejs library which compiles Markdown to HTML. In affected versions the documentation of remark-html has mentioned that it was safe by default. In practice the default was never safe and had to be opted into. That is, user input was not sanitized. This means arbitrary HTML can be passed through leading to potential XSS attacks. The problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation. On older affected versions, pass `sanitize: true` if you cannot update.","status":"published","published":"2021-09-07T18:50:11Z","modified":"2024-08-04T01:58:18.276Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N","level":"critical","assessor":"cna"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:33:09.540052Z"}],"euvd":[{"id":"EUVD-2021-2027","description":"remark-html is an open source nodejs library which compiles Markdown to HTML. In affected versions the documentation of remark-html has mentioned that it was safe by default. In practice the default was never safe and had to be opted into. That is, user input was not sanitized. This means arbitrary HTML can be passed through leading to potential XSS attacks. The problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation. On older affected versions, pass `sanitize: true` if you cannot update.","status":"published","published":"2021-09-07T18:50:11Z","modified":"2024-08-04T01:58:18Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N","level":"critical"}],"updated_at":"2026-11-03T03:24:24.305495Z"}],"ghsa":[{"id":"GHSA-9q5w-79cv-947m","title":"Unsafe defaults in `remark-html`","description":"### Impact\n\nThe documentation of `remark-html` has mentioned that it was safe by default. In practise the default was never safe and had to be opted into. This means arbitrary HTML can be passed through leading to potential XSS attacks.\n\n### Patches\n\nThe problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation.\n\n### Workarounds\n\nOn older affected versions, pass `sanitize: true`, like so:\n\n```diff\n-  .use(remarkHtml)\n+  .use(remarkHtml, {sanitize: true})\n```\n\n### References\n\nn/a\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [`remark-html`](https://github.com/remarkjs/remark-html)\n* Email us at [security@unifiedjs.com](mailto:security@unifiedjs.com)\n","status":"published","published":"2021-09-07T23:10:56Z","modified":"2023-02-01T05:06:18Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N","level":"critical"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:36:38.281533Z"}],"nvd":[{"id":"CVE-2021-39199","description":"remark-html is an open source nodejs library which compiles Markdown to HTML. In affected versions the documentation of remark-html has mentioned that it was safe by default. In practice the default was never safe and had to be opted into. That is, user input was not sanitized. This means arbitrary HTML can be passed through leading to potential XSS attacks. The problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation. On older affected versions, pass `sanitize: true` if you cannot update.","status":"published","published":"2021-09-07T19:15:08.747Z","modified":"2026-06-17T04:03:17.84Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N","level":"critical","assessor":"secondary"},{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium","assessor":"primary"},{"version":"2.0","score":4.3,"vector":"AV:N/AC:M/Au:N/C:N/I:P/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T14:06:58.05696Z"}],"osv":[{"id":"CVE-2021-39199","description":"remark-html is an open source nodejs library which compiles Markdown to HTML. In affected versions the documentation of remark-html has mentioned that it was safe by default. In practice the default was never safe and had to be opted into. That is, user input was not sanitized. This means arbitrary HTML can be passed through leading to potential XSS attacks. The problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation. On older affected versions, pass `sanitize: true` if you cannot update.","status":"published","published":"2021-09-07T19:15:08.747Z","modified":"2026-10-20T10:54:53.928599791Z","cvss":[{"version":"3.1","score":6.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T15:44:20.843843Z"},{"id":"GHSA-9q5w-79cv-947m","title":"Unsafe defaults in `remark-html`","description":"### Impact\n\nThe documentation of `remark-html` has mentioned that it was safe by default. In practise the default was never safe and had to be opted into. This means arbitrary HTML can be passed through leading to potential XSS attacks.\n\n### Patches\n\nThe problem has been patched in 13.0.2 and 14.0.1: `remark-html` is now safe by default, and the implementation matches the documentation.\n\n### Workarounds\n\nOn older affected versions, pass `sanitize: true`, like so:\n\n```diff\n-  .use(remarkHtml)\n+  .use(remarkHtml, {sanitize: true})\n```\n\n### References\n\nn/a\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n* Open an issue in [`remark-html`](https://github.com/remarkjs/remark-html)\n* Email us at [security@unifiedjs.com](mailto:security@unifiedjs.com)\n","status":"published","published":"2021-09-07T23:10:56Z","modified":"2026-07-08T06:28:59.698476878Z","cvss":[{"version":"3.1","score":10,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N","level":"critical"}],"cwes":["CWE-79"],"updated_at":"2026-11-02T15:46:44.225359Z"}]}}
