Accusoft ImageGear tif_parse_sub_IFD use-after-free vulnerability
A use-after-free flaw in the tif_parse_sub_IFD handling of Accusoft ImageGear 20.1 allows a malformed TIF file to trigger recursive freeing of an already freed IFD record. An attacker could deliver such a file to cause a crash and potentially achieve arbitrary code execution.
Originally disclosed on Cisco Talos
A use-after-free vulnerability exists in the tifparsesubIFD functionality of Accusoft ImageGear 20.1. A specially crafted malformed file can lead to arbitrary code execution.
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 recursive free routine does not check whether a sub-IFD record has already been freed before recursing into it again.
Impact
A malformed file could cause a crash and potentially arbitrary code execution, though the report only demonstrates a crash under the debugger.
What the attacker needed
Victim opens a malformed TIF file; application uses ImageGear 20.1
How it was found
- Craft a malformed TIF file whose directory entry count leads to a small IFD record allocation.
- Load the file through the ImageGear library so the TIF parser processes the directory entries.
- The parser follows a sub-IFD tag and recurses into the free routine on the same record.
- The recursive call dereferences the already freed IFD record and crashes.
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 frees a piece of memory and then keeps using it as if it were still valid. Here, a specially crafted image file makes the library free the same internal record twice, so the second use touches memory that no longer belongs to it. This can crash the program and, in the worst case, 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.