Skip to content
Memory corruption Advisory Advanced CVE-2021-21958

Hancom Office 2020 Hword HwordApp.dll SectorLoc heap-based buffer overflow

A heap-based buffer overflow exists in Hancom Office 2020's HwordApp.dll when parsing a malformed Compound File Directory Entry. An attacker can provide a malicious file to trigger memory corruption and potentially achieve arbitrary code execution.

Marcin Follow

Originally disclosed on Cisco Talos

High 7.8 View original

A heap-based buffer overflow vulnerability exists in the Hword HwordApp.dll functionality of Hancom Office 2020 11.0.0.2353. A specially-crafted malformed file can lead to memory corruption and potential arbitrary 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 code allocates a fixed 0x40-byte buffer but then reads a larger size (0x54) into it because a size check incorrectly passes when the stream size is larger than the buffer.

What the attacker needed

Victim opens a malicious file; Hancom Office 2020 installed

How it was found

  1. Enable PageHeap for Hword.exe.
  2. Open the malicious file in Hancom Office 2020.
  3. The debugger stops with an access violation in memcpy.

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 buffer overflow happens when a program tries to write more data into a fixed-size memory area than it can hold, causing nearby memory to be overwritten. Here, a malformed file causes the program to copy too many bytes into a small 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.

More by Marcin

View all

1 more disclosed report, 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.