Repository navigation
fix: bugs found by fuzz/ - #232
Open
tvanderstad wants to merge 7 commits into
Open
tvanderstad wants to merge 7 commits into
tvanderstad wants to merge 7 commits into
Conversation
A macro that references itself, directly, mutually, through its arguments or through an environment, expanded forever. One conversion may now expand macro definitions and substituted arguments to at most 5 KB, MathJax's maxBuffer; environment bodies are copied from the source and do not count. The most macro-heavy of six arXiv papers expands to 1.3 KB.
This branch has not been deployed
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.
I ran the afl harness in
fuzz/for 90 seconds and found 4 panics and 1 infinite loop:\begin{tabular} a \end{tabular},\newcommand{\begin{matrix}_,\newcommand{\x}{a#}\x,__\limits\newcommand{\x}{\x}\xEach panic takes the form of assuming an input is valid. For example,
\begin{tabular} a \end{tabular}: the parser expects a second{lcr}argument after\begin{tabular}, and when it getsainstead it panics trying to slice one character off each end. The fixes come with tests that fail without this PR's changes and pass with. One is already fixed by #226 so I left it out.The loop is a somewhat annoying case where
\newcommand{\x}{\x}\xdefines\xas itself and then uses it. The fix is a 5 KBMAX_EXPANDED_BYTES, the same as MathJax'smaxBuffer; I tried a few big arXiv papers and nothing exceeded 1.3 KB.These changes were written by Claude Opus 5.5 Medium so I cannot vouch for them other than the evidence I've presented.