Skip to content
Memory corruption Advisory Advanced CVE-2026-42057

vtk vtkPNGReader::vtkPNGReaderUpdate2 invalid pointer dereference vulnerability

A malformed PNG file causes the PNG reader to recover from a libpng error using a stack frame that has already returned, so a corrupted file pointer is later passed to fclose. An attacker could supply such a file to crash the application, and the text notes it may become a control-flow redirection primitive.

Emmanuel Tacheau Follow

Originally disclosed on Cisco Talos

High 7.5 View original

A invalid pointer dereference vulnerability exists in the vtkPNGReader::vtkPNGReaderUpdate2 functionality of vtk (version(s): 9.6). A specially crafted .png file can lead to a denial of service.

Emmanuel Tacheau, on Cisco Talos

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

Likely the setjmp checkpoint lives in a helper function that returns before the libpng decode calls, so a later longjmp resumes in a dead stack frame whose local file pointer has been overwritten.

Impact

A crafted PNG file can crash the application (denial of service), and the text says it could become a control-flow redirection primitive, though glibc's vtable check may turn many attempts into an abort instead.

What the attacker needed

Attacker supplies a crafted PNG file; victim opens the file with vtk

The fix

The setjmp logic should be moved into the same function that performs the libpng operations so the longjmp always returns to a live stack frame.

How it was found

  1. Open a malformed PNG file with the reader so that metadata parsing succeeds.
  2. Let the failure occur later during image decoding or end-of-file handling.
  3. libpng triggers a longjmp back into the already-returned error handler.
  4. The stale file pointer is used in fclose, causing a segmentation fault.

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.

When a program reads a file it can hit an error, and it uses a saved checkpoint to jump back and clean up. Here the checkpoint was saved inside a helper function that had already finished, so the cleanup ran with stale, garbage data and the program crashed. A crafted image file is enough to trigger this.

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 Emmanuel Tacheau

View all

58 more disclosed reports, best first.

More from Cisco Talos

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.