Skip to content
Memory corruption Advisory Advanced CVE-2019-5041

Aspose Aspose.Words for C++ EnumMetaInfo Code Execution Vulnerability

A malformed DOC file causes the Aspose.Words for C++ library to read an uninitialised element from an internal string collection, which is then copied into a fixed-size stack buffer. An attacker who supplies such a file to a victim could trigger a stack-based buffer overflow that may lead to remote code execution.

Marcin 'Icewall' Noga Follow

Originally disclosed on Cisco Talos

Critical 9.8 View original

An exploitable Stack Based Buffer Overflow vulnerability exists in the EnumMetaInfo function of Aspose Aspose.Words for C++, version 18.11.0.0. A specially crafted doc file can cause a stack-based buffer overflow, resulting in remote code execution.

Marcin 'Icewall' Noga, on Cisco Talos

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 loop bound for the string collection is computed from file-supplied PLC structure sizes, so it can exceed the number of initialised entries and an uninitialised element is copied into a fixed 0x44-byte stack buffer.

Impact

A crafted DOC file could cause a stack-based buffer overflow that may be turned into remote code execution, though the report only demonstrates a crash with a corrupted exception handler.

What the attacker needed

Victim opens a malformed DOC file; Aspose.Words for C++ [redacted]

The fix

The vendor patched the issue after it was reported.

How it was found

  1. Create an Aspose::Words::Document object from a malformed DOC file.
  2. The library builds a StringCollection from data in the file around offset 0xB6D0.
  3. The iteration limit is computed from the PLC structure sizes, giving a value larger than the initialised entries.
  4. An uninitialised element is fetched and passed to the String constructor.
  5. The String constructor copies 0x180 bytes into a 0x44-byte stack buffer, corrupting the SEH chain.

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 library reads a list of strings from a file and copies one of them into a small fixed-size space on the stack. Because of a counting mistake it can pick an entry that was never filled in, so the copy is larger than the space and overwrites nearby memory. Overwriting memory this way can let an attacker run their own code when the victim opens the file.

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.

More by Marcin 'Icewall' Noga

View all

146 more disclosed reports, best first.

More from Cisco Talos

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.