{"id":"CVE-2025-59717","aliases":["EUVD-2025-30235","GHSA-2h8j-8r9p-849f"],"status":"published","title":"@digitalocean/do-markdownit has Type Confusion vulnerability","description":"In the @digitalocean/do-markdownit package through 1.16.1 (in npm), the callout and fence_environment plugins perform .includes substring matching if allowedClasses or allowedEnvironments is a string (instead of an array).","severity":{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00387,"percentile":0.33275,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-843"],"published":"2025-09-19T00:00:00Z","modified":"2026-10-28T02:30:28Z","affected":[{"source":"ghsa","ecosystem":"npm","package":"@digitalocean/do-markdownit","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.16.1"}]}]},{"source":"osv","ecosystem":"npm","package":"@digitalocean/do-markdownit","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"1.16.1"}]}]}],"products":[{"vendor":"digitalocean","product":"@digitalocean/do-markdownit"},{"vendor":"digitalocean","product":"do-markdownit"}],"references":[{"url":"https://github.com/digitalocean/do-markdownit","tags":["Product","package"]},{"url":"https://gist.github.com/thesmartshadow/dd19665f1f51a4e3c7a766e70c9eafd0","tags":["exploit","Exploit","Third Party Advisory","web"]},{"url":"https://www.npmjs.com/package/@digitalocean/do-markdownit","tags":["Product","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59717","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-2h8j-8r9p-849f"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/59xxx/CVE-2025-59717.json","tags":["advisory"]}],"sources":{"cve":[{"id":"CVE-2025-59717","description":"In the @digitalocean/do-markdownit package through 1.16.1 (in npm), the callout and fence_environment plugins perform .includes substring matching if allowedClasses or allowedEnvironments is a string (instead of an array).","status":"published","published":"2025-09-19T00:00:00Z","modified":"2025-09-19T13:32:08.575Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-843"],"updated_at":"2026-11-02T14:32:47.812946Z"}],"euvd":[{"id":"EUVD-2025-30235","description":"In the @digitalocean/do-markdownit package through 1.16.1 (in npm), the callout and fence_environment plugins perform .includes substring matching if allowedClasses or allowedEnvironments is a string (instead of an array).","status":"published","published":"2025-09-19T00:00:00Z","modified":"2025-09-19T13:32:08Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium"}],"updated_at":"2026-11-02T20:31:41.254663Z"}],"ghsa":[{"id":"GHSA-2h8j-8r9p-849f","title":"@digitalocean/do-markdownit has Type Confusion vulnerability","description":"### Overview\nA type confusion issue exists in the `@digitalocean/do-markdownit` package. In the `callout` and `fence_environment` plugins, the `allowedClasses` and `allowedEnvironments` options are expected to be arrays of strings. If these options are provided as a single string, the code applies `.includes` directly on the string, resulting in substring matching instead of membership checks against an array.\n\n### Affected Versions\nAll versions up to and including 1.16.1 (npm).\n\n### Impact\nSupplying crafted input can bypass intended allow-lists (e.g., class/environment constraints) due to substring checks, which may enable rendering of unintended classes or environments and lead to policy bypass in downstream consumers.\n\n### Mitigation\nUntil an upstream fix is released, ensure configuration normalization before invoking the plugins:\n- Validate that `allowedClasses` and `allowedEnvironments` are arrays (`Array.isArray(...)`), converting single strings into one-element arrays when necessary.\n- Consider sanitizing or strictly validating user-controlled values that influence Markdown rendering.","status":"published","published":"2025-09-19T06:31:21Z","modified":"2025-09-22T22:55:38Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-843"],"updated_at":"2026-11-02T14:38:58.965005Z"}],"nvd":[{"id":"CVE-2025-59717","description":"In the @digitalocean/do-markdownit package through 1.16.1 (in npm), the callout and fence_environment plugins perform .includes substring matching if allowedClasses or allowedEnvironments is a string (instead of an array).","status":"published","published":"2025-09-19T04:16:49.457Z","modified":"2026-06-17T09:46:35.68Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium","assessor":"secondary"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-843"],"updated_at":"2026-11-02T14:11:30.865098Z"}],"osv":[{"id":"CVE-2025-59717","description":"In the @digitalocean/do-markdownit package through 1.16.1 (in npm), the callout and fence_environment plugins perform .includes substring matching if allowedClasses or allowedEnvironments is a string (instead of an array).","status":"published","published":"2025-09-19T00:00:00Z","modified":"2026-10-28T02:30:28.018095677Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-843"],"updated_at":"2026-11-02T15:44:51.516975Z"},{"id":"GHSA-2h8j-8r9p-849f","title":"@digitalocean/do-markdownit has Type Confusion vulnerability","description":"### Overview\nA type confusion issue exists in the `@digitalocean/do-markdownit` package. In the `callout` and `fence_environment` plugins, the `allowedClasses` and `allowedEnvironments` options are expected to be arrays of strings. If these options are provided as a single string, the code applies `.includes` directly on the string, resulting in substring matching instead of membership checks against an array.\n\n### Affected Versions\nAll versions up to and including 1.16.1 (npm).\n\n### Impact\nSupplying crafted input can bypass intended allow-lists (e.g., class/environment constraints) due to substring checks, which may enable rendering of unintended classes or environments and lead to policy bypass in downstream consumers.\n\n### Mitigation\nUntil an upstream fix is released, ensure configuration normalization before invoking the plugins:\n- Validate that `allowedClasses` and `allowedEnvironments` are arrays (`Array.isArray(...)`), converting single strings into one-element arrays when necessary.\n- Consider sanitizing or strictly validating user-controlled values that influence Markdown rendering.","status":"published","published":"2025-09-19T06:31:21Z","modified":"2025-09-22T22:55:37Z","cvss":[{"version":"3.1","score":5.4,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:L/A:N","level":"medium"}],"cwes":["CWE-843"],"updated_at":"2026-11-02T15:46:34.338541Z"}]}}
