libxls xls_appendSST Code Execution Vulnerability
An integer overflow in the xls_appendSST function of libxls 1.4 allows a crafted XLS file to cause an out-of-bounds write, leading to memory corruption and potential remote code execution.
Originally disclosed on Cisco Talos
An exploitable integer overflow vulnerability exists in the xlsappendSST function of libxls 1.4. A specially crafted XLS file can cause memory corruption resulting in remote 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
The number of strings from the file is used to allocate an array, but the code later writes more entries than allocated because it does not check the count against the actual number of strings.
Impact
A crafted XLS file could cause memory corruption and potentially allow remote code execution.
What the attacker needed
Victim opens a malicious XLS file
How it was found
- Craft an XLS file with an SST record where the string count is set to 1 but multiple strings are present.
- Open the crafted file with a program that uses libxls, such as the readxl package in R.
- The program allocates space for one string but attempts to store more, causing an out-of-bounds write.
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.
libxls is a library that reads old Excel files. A bug in how it counts strings lets a malicious file write past the end of a memory buffer, which can crash the program or 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.