Skip to content
Memory corruption Advisory Advanced CVE-2017-2819

Hancom Thinkfree NEO Hangul Word Processor HWPTAG_TAB_DEF Tab Count Code Execution Vulnerability

A signedness error in the Hangul Word Processor's handling of tab definition records causes an integer underflow, leading to a heap buffer overflow when reading tab data. An attacker could exploit this by crafting a malicious document, potentially achieving code execution under the application's context.

A member Follow

Originally disclosed on Cisco Talos

High 8.8 View original

An exploitable heap-based buffer overflow exists in the Hangul Word Processor component (version 9.6.1.4350) of Hancom Thinkfree Office NEO 9.6.1.4902. A specially crafted document stream can cause an integer underflow resulting in a buffer overflow which can lead to code execution under the context of the application.

a member, 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 a signed comparison in the buffer resize function causes a negative tab count to be treated as smaller than the current size, so the buffer is not enlarged before data is copied into it.

Impact

This could lead to code execution under the context of the application, allowing an attacker to run arbitrary code on the victim's system.

What the attacker needed

Victim opens a malicious .hwp file; vulnerable Hancom Thinkfree Office NEO version

How it was found

  1. Create a document with a FileHeader stream that sets the compressed flag.
  2. Include a DocInfo stream containing at least one HWPTAG_TAB_DEF record to allocate the tab array.
  3. Add another HWPTAG_TAB_DEF record with a negative tab count to bypass the resize check.
  4. Open the document in the vulnerable application to trigger the overflow.

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.

This report describes a flaw in a word processor that opens .hwp files. When the program reads a list of tab settings from a file, it miscalculates how much memory to reserve because it treats a number as signed instead of unsigned. This lets a malicious file trick the program into writing more data than the reserved space, which can crash it 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 A member

View all

110 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.