You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Request a 0.13.5 patch release: exponential blowup with ENABLE_WIKILINKS (#1102) and two panics (#1111, #1129) #1179
The latest release, 0.13.4, has three bugs that a small hostile document can trigger. All three are already fixed on main but not on branch_0.13. We found them by fuzzing a downstream markdown viewer that renders untrusted files. I'm filing this publicly because the repository has no SECURITY.md and private vulnerability reporting is not enabled. The fixes, and the repro tests that go with them, are already public in merged PRs.
1. Exponential event growth with ENABLE_WIKILINKS (fixed on main by #1102)
use pulldown_cmark::{Options,Parser};for n in[1,2,3,10,16]{let text = "[[a|]] ".repeat(n);let events = Parser::new_ext(&text,Options::ENABLE_WIKILINKS).count();println!("n={n}: {events} events");}
The event count roughly doubles with each [[a|]], and the duplicated events become duplicated output. In our fuzzer, documents of 2–4 KB drove the process past 16 GB RSS. Any tool/service that renders untrusted markdown with wikilinks enabled can be knocked over this way. Without ENABLE_WIKILINKS, this bug doesn't apply.
2. Panic in handle_wikilink on malformed input (fixed on main by #1111, issue #1108)
" \u{fffd} ![[] ]()]]" with Options::all().
3. Panic in into_offset_iter() on 13 bytes, with no options needed (#1129, still open)
Parser::new("- [o]:u\n \t").into_offset_iter().count() panics at parse.rs:2199. #1129 traces this to edee73b7, which is on main and not in any 0.13.x release, and posts a one-hunk backport for branch_0.13.
Verification
We applied #1102, #1111 and the firstpass.rs hunk of edee73b7 to the 0.13.4 source. Every repro above is then clean, and our test suite passes against the patched crate. main itself isn't a drop-in replacement for 0.13 users: Tag::ContainerBlock and Tag::Highlight break exhaustive matches, and default-features = false now needs features = ["std"].
Ask
A 0.13.5 cut from branch_0.13 with those three cherry-picks. I'm happy to open that PR against branch_0.13 if it would help.
Once a patched version exists, we'd like to file a RustSec advisory for (1), so that cargo audit and Dependabot users learn to upgrade. We'll coordinate the wording and timing with you first.
Please consider turning on GitHub's private vulnerability reporting, or adding a SECURITY.md, for the next report of this kind.
Thanks for the crate, and for the fixes, which were already in main.
Hi, thanks for the response. Sorry, it was a bit sloppy on my part - I should have said that #1129 is already fixed on main with commit edee73b (#997)
I verified it on branch_0.13: with edee73b cherry-picked, every repro in #1129 and its comments is clean and the test suite passes, and a short, targeted fuzzing session on into_offset_iter came out all clean.
So all three fixes are ready to backport (once verified).
Hi, as mentioend in the original post; here's the draft advisory for the wikilinks blowup (#1102). It Covers 0.13.0–0.13.4, points to 0.13.5, and excludes the other two panics.
Let me know if the wording needs tweaking before we file. If you'd rather discuss the wording in private, you can email me at: a @ onedaybeard dot net
When Options::ENABLE_WIKILINKS is enabled, a wikilink with a pipe separator and empty display text, such as [[a|]], leaks its child node's sibling chain into the content that follows it. Each such link roughly doubles the number of events the parser yields for the rest of the document, so output grows exponentially with input size: 16 repetitions of [[a|]] (112 bytes) yield 327,676 events, where the fixed parser yields 65. A document of a few kilobytes is enough to exhaust memory in a process that collects the events or renders them to HTML.
Applications that parse untrusted Markdown with ENABLE_WIKILINKS set, including through Options::all(), are affected. The option is off by default. Parsing without it is not affected.
The flaw was fixed in #1102 and released in 0.13.5.
Activity
Martin1887 commentedon Oct 19, 2026
Thanks, you are right. But #1129 is still open, fixing it before releasing 0.13.5 would be desirable.
junkdog commentedon Oct 19, 2026
Hi, thanks for the response. Sorry, it was a bit sloppy on my part - I should have said that #1129 is already fixed on
mainwith commit edee73b (#997)I verified it on
branch_0.13: with edee73b cherry-picked, every repro in #1129 and its comments is clean and the test suite passes, and a short, targeted fuzzing session oninto_offset_itercame out all clean.So all three fixes are ready to backport (once verified).
Martin1887 commentedon Oct 21, 2026
Just released. We will also analyse to introduce a SECURITY.md file or security information in GitHub.
Thanks!
junkdog commentedon Oct 26, 2026
Hi, as mentioend in the original post; here's the draft advisory for the wikilinks blowup (#1102). It Covers 0.13.0–0.13.4, points to 0.13.5, and excludes the other two panics.
Let me know if the wording needs tweaking before we file. If you'd rather discuss the wording in private, you can email me at: a @ onedaybeard dot net
The Draft:
Exponential event growth with
ENABLE_WIKILINKSWhen
Options::ENABLE_WIKILINKSis enabled, a wikilink with a pipe separator and empty display text, such as[[a|]], leaks its child node's sibling chain into the content that follows it. Each such link roughly doubles the number of events the parser yields for the rest of the document, so output grows exponentially with input size: 16 repetitions of[[a|]](112 bytes) yield 327,676 events, where the fixed parser yields 65. A document of a few kilobytes is enough to exhaust memory in a process that collects the events or renders them to HTML.Applications that parse untrusted Markdown with
ENABLE_WIKILINKSset, including throughOptions::all(), are affected. The option is off by default. Parsing without it is not affected.The flaw was fixed in #1102 and released in 0.13.5.
Martin1887 commentedon Oct 27, 2026
It looks good to me, thanks!