Intel

AIKIDO-2026-346353

mupdf is vulnerable to Use After Free

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Jul 6, 2026
July 6, 2026

43

CVE Score

Medium

Use After Free

Are you affected? Scan for Free

TL;DR

The mupdf crate's PdfAnnotation stores a raw pointer to a MuPDF pdf_annot, and its annotation iterator yields these wrappers without keeping the parent PdfPage alive or taking a reference on the borrowed annotation. Because MuPDF exposes only a non-refcounted back-pointer from an annotation to its page, dropping the page while annotations remain in use, or iterating annotations and dropping the wrappers, frees memory that is still referenced. Processing or rendering a PDF that carries annotations then dereferences freed memory, causing crashes or memory corruption. The fix makes PdfAnnotation hold a ref-counted parent page handle, adds a borrowed-pointer constructor for the iterator, and applies correct refcounting.

How do I fix this?

Upgrade the mupdf library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and your application iterates or renders PDF annotations.

Package

Versions

0.0.2 - 0.6.0

Fixed in 0.7.0

Background info

mupdf is vulnerable to Use After Free in versions 0.0.2 - 0.6.0.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea