PDFsharp icon indicating copy to clipboard operation
PDFsharp copied to clipboard

Parser.ReadTrailer Bug leads the parser to hang indefinitely.

Open AdvDebug opened this issue 9 months ago • 1 comments

Hey, i found a parsing issue in the PdfReader.Parse which causes the parser to hang indefinitely, specifically in the Parser.ReadTrailer and more specifically in the ReadSize call, didn't really dig deeper into the issue itself though.

Expected Behavior

The reader throws an exception since the PDF is not valid.

Actual Behavior

The parser hangs indefinitely.

Steps to Reproduce the Behavior

Use PdfReader.Open on the following PDF:

Hang.zip

which will cause the parser to hang.

Found via BinarySploit Framework Fuzzing component (A project i'm still working on)

AdvDebug avatar May 21 '25 07:05 AdvDebug

Thanks for the feedback. I can replicate the issue.

ThomasHoevel avatar May 26 '25 10:05 ThomasHoevel