Catdoc utilities OLE Document Parser File Allocation Table 32-bit integer overflow vulnerability
An integer overflow in the OLE Document File Allocation Table parser of catdoc 0.95 can cause a heap buffer overflow when a malformed file is processed. An attacker could exploit this to achieve code execution under the context of the binary, but only on 32-bit builds.
An integer overflow vulnerability exists in the OLE Document File Allocation Table Parser functionality of catdoc 0.95. A specially crafted malformed file can lead to heap-based memory corruption.
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 product of the number of FAT sectors and the sector size is computed in 32 bits and can overflow, leading to an undersized heap allocation that is then overflowed by a subsequent read.
Impact
This could allow code execution under the context of the binary, but only affects 32-bit versions of catdoc, xls2csv, and catppt.
What the attacker needed
32-bit build of catdoc; malicious file opened by victim
How it was found
- Generate a malicious document using the provided Python script.
- Run the 32-bit build of catdoc on the generated document.
- Observe the heap buffer overflow 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.
catdoc is a program that extracts text from old Microsoft Word files. When it reads a file, it calculates how much memory to set aside for a table inside the file. If the numbers in the file are chosen badly, the calculation wraps around and the program sets aside too little memory, then writes more data than fits, corrupting memory. This could let an attacker run their own code, but only if the program is built for 32-bit systems.
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.