Catdoc xls2csv utility Shared String Table Record Parser memory corruption vulnerability
The xls2csv utility in catdoc 0.95 has a heap buffer overflow in its Shared String Table parser. A crafted Excel file with a large string count can cause an undersized allocation and out-of-bounds writes, potentially leading to memory corruption.
A memory corruption vulnerability exists in the Shared String Table Record Parser implementation in xls2csv utility version 0.95. A specially crafted malformed file can lead to a heap 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 an integer overflow when multiplying the file-supplied string count by the pointer size, producing an undersized allocation that the subsequent loop writes past.
Impact
An attacker could cause memory corruption, potentially leading to code execution or a crash, though the report only demonstrates a crash under AddressSanitizer on a 32-bit build.
What the attacker needed
Victim opens a malicious Excel file; 32-bit build of xls2csv
How it was found
- Generate a malicious Excel document with the provided proof-of-concept script.
- Run the xls2csv binary against the generated file.
- Observe the heap buffer overflow reported by AddressSanitizer.
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.
xls2csv is a small program that turns Excel spreadsheets into plain text. It trusts a number stored in the file when deciding how much memory to reserve, so a malicious file can make it reserve too little and then write past the end of that memory, which can crash the program or corrupt data.
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.