@digitalocean/do-markdownit has Type Confusion vulnerability
Moderate severity
GitHub Reviewed
Published
Sep 19, 2025
to the GitHub Advisory Database
•
Updated Sep 22, 2025
Description
Published by the National Vulnerability Database
Sep 19, 2025
Published to the GitHub Advisory Database
Sep 19, 2025
Reviewed
Sep 19, 2025
Last updated
Sep 22, 2025
Overview
A type confusion issue exists in the
@digitalocean/do-markdownit
package. In thecallout
andfence_environment
plugins, theallowedClasses
andallowedEnvironments
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.Affected Versions
All versions up to and including 1.16.1 (npm).
Impact
Supplying 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.
Mitigation
Until an upstream fix is released, ensure configuration normalization before invoking the plugins:
allowedClasses
andallowedEnvironments
are arrays (Array.isArray(...)
), converting single strings into one-element arrays when necessary.References