Skip to content

fix(render): prevent unsafe reference links from footnote bodies - #57

Merged
chaliy merged 1 commit into
mainfrom
fix/footnote-reference-injection
Oct 28, 2026
Merged

chaliy merged 1 commit into
mainfrom
fix/footnote-reference-injection

Conversation

@chaliy

@chaliy chaliy commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

What changed

Footnote definitions now put their indented body after a blank line. Readers without footnote support can no longer interpret body text as a reference-link destination; readers with footnote support retain the footnote and its text.

Why

The existing nightly render_ir fuzz run found a violation of output-safety invariant S17. A body such as javascript:alert(1) became a link destination when followed by a footnote reference in a reader without footnotes.

Before / After

Before: [^note]: javascript:alert(1) plus [^note] parsed as an unsafe link.
After: the marker and indented body are separated by a blank line; the same reader emits no link.

The new regression failed before the fix and passes afterward for JavaScript, VBScript and file destinations, with assertions for both reader modes. just pre-pr passed. CLI, Python and Node binding smoke tests passed.

Risk

  • Low: footnote serialization changes whitespace; Markdown readers with footnote support retain semantics.
  • Existing HTML and Markdown expectations were updated. Threat model and changelog describe the safety contract.

Checklist

  • Tests added or updated
  • Backward compatibility considered

@chaliy
chaliy merged commit 0c876e7 into main Oct 28, 2026
13 checks 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.

1 participant