You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In src/extra.i (JM_set_annot_callout_line), a fixed stack buffer of 3 points (fz_point points[3]) is indexed up to
caller-controlled count. In src/__init__.py:9816–9817, Page.add_freetext_annot(..., callout=...) passes point_count = len(callout) without length bounds validation.MuPDF's pdf_set_annot_callout_line, a callout line (/CL) has either 2 or 3 points.
Passing >= 4 points writes past the stack buffer onto the stack frame, causing a SIGBUS crash.
Because each point coordinate corresponds to two IEEE-754 32-bit floats, this out-of-bounds stack write overwrites callee-saved registers (RBX, RBP, R12–R14) and the saved return address (RIP). I have attached a video below demonstrating an end-to-end RCE proof-of-concept.
Description of the bug
In
src/extra.i(JM_set_annot_callout_line), a fixed stack buffer of 3 points (fz_point points[3]) is indexed up tocaller-controlled
count. Insrc/__init__.py:9816–9817,Page.add_freetext_annot(..., callout=...)passespoint_count = len(callout)without length bounds validation.MuPDF'spdf_set_annot_callout_line, a callout line (/CL) has either 2 or 3 points.Passing >= 4 points writes past the stack buffer onto the stack frame, causing a SIGBUS crash.
How to reproduce the bug
Security Impact
Because each point coordinate corresponds to two IEEE-754 32-bit floats, this out-of-bounds stack write overwrites callee-saved registers (RBX, RBP, R12–R14) and the saved return address (RIP). I have attached a video below demonstrating an end-to-end RCE proof-of-concept.
PoC Demonstration
compressed_poc_video.mp4
PyMuPDF version
1.28.2
Operating system
Linux
Python version
3.13