Skip to content

brookmd 0.30.2 — NUL bytes in markdown no longer reach rendered HTML

Latest

Choose a tag to compare

@github-actions github-actions released this 15 Sep 14:28

NUL bytes in markdown no longer reach rendered HTML. Requires
brookmd-core 0.27.1. The wire contract is unchanged at v1.2.0, and output
differs only for source that contains U+0000.

Fixed

  • U+0000 is replaced with U+FFFD in every output path (CommonMark §2.3).
    Until now a NUL in the source was copied into the HTML as-is: in paragraphs,
    code spans and blocks, math, link text, and unsafe_html pass-through,
    including the streaming HTML-block cache. The scheduled fuzzer found the
    sharper edge. Markdown containing the bytes of the parser's internal
    footnote placeholder (\0F\x01…) survived footnote resolution, which trips
    an internal invariant in debug builds and emits raw control bytes in release
    builds. Every escaper, the inline plain-text fast path, and every raw-HTML
    pass-through now substitute U+FFFD, so the placeholder can't be forged. Block
    start/end offsets still index the original source. A new core test
    splices NULs into every position of every syntax, across option sets and
    chunkings, and asserts none reaches any patch.
    brookmd-react-native 0.1.9 ships the same fix in its native core.