Mistune fixes quadratic-time denial-of-service flaw in version 3.3.4

  • Mistune
  • markdown
  • denial of service

Flaw in parse_link_href allows excessive CPU consumption

Users urged to update to version 3.3.4 or later

Mistune versions earlier than 3.3.4 contain a quadratic-time denial-of-service vulnerability in the parse_link_href function, according to the GitHub Advisory. The flaw can let an unauthenticated request consume a worker’s processing capacity when it renders untrusted Markdown.

The issue occurs when the parser handles empty-label links with an unmatched opening parenthesis. Its unbounded scan can repeat across the document, causing processing time to rise sharply as input grows. The advisory reports that a 48KB test input took about 49.8 seconds to process with the default renderer and no plugins.

Mistune fixed the vulnerability in version 3.3.4. Users should upgrade to that version or later.