SoftMaker Office TextMaker Document Record 0x001f sign-extension vulnerability
A sign-extension flaw in TextMaker's parsing of record type 0x001f lets a crafted .tmd document make the parser treat a length as negative, so a loop index is used to write outside a heap buffer while reading file data. An attacker who convinces a victim to open such a document could corrupt heap memory, potentially leading to code execution.
An exploitable sign extension vulnerability exists in the TextMaker document parsing functionality of SoftMaker Office 2021’s TextMaker application. A specially crafted document can cause the document parser to sign-extend a length used to terminate a loop, which can later result in the loop’s index being used to…
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 a 16-bit record size is handled as unsigned when passed in but later sign-extended and used as a signed loop bound, so a crafted size makes the loop write past the allocated heap buffer.
Impact
Heap memory corruption could allow an attacker to crash the application or potentially execute code, though the text only states this as a possibility.
What the attacker needed
Victim opens a crafted .tmd document; SoftMaker Office 2021 TextMaker (revision 1014)
How it was found
- Craft a .tmd file whose header matches the TextMaker signature and version range.
- Set the index table entry for record type 0x001f to a size that triggers the sign extension.
- Open the crafted document in TextMaker so the parser reads the record.
- The parser allocates a buffer from the size and then the loop index writes outside it.
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 document file is made of records, and each record says how big it is. The program reads that size as a small unsigned number, then later treats it as a signed number, so a large value can become negative. That confuses a loop that copies data, and it writes 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.