Skip to content

Add advisory for pulldown-cmark: quadratic parsing of nested image wikilinks - #3467

Merged
djc merged 1 commit into
rustsec:mainfrom
Martin1887:pulldown-cmark-nested-image-wikilinks
Nov 2, 2026
Merged

djc merged 1 commit into
rustsec:mainfrom
Martin1887:pulldown-cmark-nested-image-wikilinks

Conversation

@Martin1887

@Martin1887 Martin1887 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Affected crate(s)

  • pulldown-cmark (61.8M recent downloads per crates.io)

Links to upstream issue(s) or PR(s)

Severity

Remote denial-of-service via time exhaustion.
With Options::ENABLE_WIKILINKS, handle_wikilink builds a wikilink's target from the raw text of its body: scan_wikilink_pipe walks it looking for |, then contains('\0') and from_replace_nuls walk it again.
Once a wikilink is created, disable_all_links only disables Link entries, so every enclosing ![[ stays live on the wikilink stack.
On ![[![[![[…]]]]]] each of those openers then resolves in turn and rescans everything inside it, which is quadratic in the nesting depth.
The event count stays tiny, because in the unpiped case each enclosing image replaces its body with a fresh text node, so all of that work is thrown away.

Affects 0.13.0 through 0.13.5; wikilinks were introduced in 0.13.0, and 0.13.6 is patched.

CVSS 3.1 is 7.5, scored for a service that renders untrusted Markdown with wikilinks enabled. AC:H, to account for the option being off by default, would give 5.9.

Checklist

  • Advisory filename(s) starts with RUSTSEC-0000-0000 as the ID
  • date field is set to the public disclosure date
  • Contains a concise and descriptive title after advisory metadata
  • Asked maintainer(s) if publishing an advisory is appropriate

@djc

djc commented Oct 30, 2026

Copy link
Copy Markdown
Member

How is this different from

This declares that anything < 0.13.0 is unaffected whereas the other PR says that 0.11+ are vulnerable -- which is it?

@Martin1887

Copy link
Copy Markdown
Contributor Author

#3444 should be closed in favor of the already merged #3454/#3455.

Wikilinks were added in 0.13, so the correct value is everything below 0.13, as #3454 and #3455 say: https://github.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.13.0.

This is different than #3454 because it is about a different issue fixed in the 0.13.6 release launched today.

Thanks.

@djc
djc merged commit ab0186f into rustsec:main Nov 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants