vtk vtkPNGReader::ExecuteInformation invalid pointer dereference vulnerability
A malformed PNG file causes the vtkPNGReader to use a stale stack frame after a longjmp, so a saved file pointer no longer points to a valid FILE structure. This leads to a crash (denial of service) and, on older C libraries, could potentially allow control of execution.
Originally disclosed on Cisco Talos
A invalid pointer dereference vulnerability exists in the vtkPNGReader::ExecuteInformation functionality of vtk (version(s): 9.6). A specially crafted .png file can lead to a denial of service.
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 setjmp error handler was placed in a helper function that returns before png_read_info can longjmp back into it, so the handler's stack frame and its fp argument are stale when the error path runs.
Impact
The crafted file causes a denial of service through a crash; on glibc 2.24 and later a vtable check turns some exploitation attempts into SIGABRT, but on older or other C libraries it could potentially redirect execution.
What the attacker needed
Attacker supplies a crafted PNG file; victim opens the file with vtk
How it was found
- Open a crafted PNG file with the vtkPNGReader.
- The reader sets up the libpng error handler and then calls png_read_info.
- The malformed PNG makes libpng longjmp back into the already-returned handler.
- The handler calls fclose on a stale file pointer, causing a crash.
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 PNG reader sets up an error handler that saves a pointer to the open file. When a bad PNG triggers an error later, the handler runs again but its memory has already been reused, so the saved pointer is garbage. Closing that garbage pointer crashes the program, and on older systems it might let an attacker 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.