VTK vtkWindBladeReader FindVariableOffsets heap-based buffer overflow vulnerability
The WindBlade reader in VTK computes a buffer size from an attacker-controlled signed integer in the binary data file, so a small or negative value yields a zero-length allocation. The reader then loops over grid extents and reads past that buffer, causing a crash and, on normal builds, possible heap data exposure.
Originally disclosed on Cisco Talos
A heap-based buffer overflow vulnerability exists in the vtkWindBladeReader FindVariableOffsets functionality of vtk (version(s): 9.6.1). A specially crafted .wind can lead to a buffer overflow.
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 signed byte count read from the data file is divided by four and stored as the buffer size without any validation, so values between -3 and 3 give a zero-sized allocation that is later indexed using unchecked grid extents.
Impact
An attacker can cause a deterministic denial of service, and on non-instrumented builds the out-of-bounds reads may expose heap-resident data through the output arrays.
What the attacker needed
Victim opens a crafted WindBlade data set
The fix
The reader should validate the byte count, rejecting values that are not positive or not consistent with the declared grid dimensions, before using it as a buffer size.
How it was found
- Open a crafted WindBlade data set whose binary file holds a byte count that divides down to zero.
- The reader parses the metadata and computes a zero block size during the information phase.
- The data phase allocates a minimal buffer and loops over the declared grid extents.
- The loop reads past the end of the buffer, which AddressSanitizer reports as a heap overflow.
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.
VTK is a library for visualising scientific data, and it can open a WindBlade data set made of a text description file plus binary data files. The program trusts a number stored in the binary file to decide how much memory to reserve, but it never checks that the number makes sense. When the number is tiny, it reserves almost nothing yet still copies data into it, so it reads memory it does not own and crashes.
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.