Repository navigation
fix(render): prevent unsafe reference links from footnote bodies - #57
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_irfuzz run found a violation of output-safety invariant S17. A body such asjavascript: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-prpassed. CLI, Python and Node binding smoke tests passed.Risk
Checklist