Skip to content
Memory corruption Advisory Advanced CVE-2025-52885

GHSL-2025-042: Use After Free (UAF) in Poppler - CVE-2025-52885

A use-after-free write vulnerability exists in Poppler's StructTreeRoot class because raw pointers to std::vector elements become dangling when the vector is resized. An attacker could potentially exploit this to achieve code execution.

antonio-morales Follow

Originally disclosed on GitHub Security Lab

A use-after-free (write) vulnerability has been detected in Poppler within the StructTreeRoot class. The issue arises from the use of raw pointers to elements of a std::vector, which can lead to dangling pointers when the vector is resized.

antonio-morales, on GitHub Security Lab

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The code stores raw pointers to elements of a std::vector in a multimap, but later resizing the vector invalidates those pointers, leading to a dangling pointer that is subsequently written to.

Impact

It’s possible that this use-after-free bug could be exploited to achieve code execution in poppler.

What the attacker needed

Victim opens a malicious PDF

The fix

The issue was fixed by a merge request that likely changes the code to avoid storing raw pointers to vector elements, for example by using indices or a different container.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A use-after-free happens when a program keeps a pointer to memory that has been freed and then writes to it. Here, the program stored pointers to items in a list, but when the list grew, the old memory was freed and the pointers became invalid. An attacker could craft a malicious PDF to trigger this and possibly run their own code.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by antonio-morales

View all

45 more disclosed reports, best first.

More from GitHub Security Lab

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.