Skip to content
Memory corruption Advisory Advanced CVE-2016-4289

GMER Path Length Code Execution Vulnerability

A stack-based buffer overflow exists in GMER's handling of directory names shown in a tree view control. An attacker who can create a directory name longer than 99 characters could overflow a stack buffer and potentially execute code.

Marcin 'Icewall' Noga Follow

Originally disclosed on Cisco Talos

A stack based buffer overflow vulnerability exists in the method receiving data from SysTreeView32 control of the GMER application. A specially created long path can lead to a buffer overflow on the stack resulting in 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

The code passed a character count of 200 to a Unicode tree view message while the destination buffer was only sized for 200 ANSI characters, so the Unicode data overflowed it.

Impact

A specially crafted long path could overflow the stack and lead to code execution, though the CVSS vector in the text rates only availability impact as high.

What the attacker needed

Local access to create a directory; user opens GMER Files tab

The fix

The buffer should be declared as a wide-character buffer and sized to 256 times the size of a wide character so the whole directory name fits.

How it was found

  1. Create a directory whose name is longer than 99 characters.
  2. Open GMER and select the Files tab so the folder appears in the tree view control.
  3. The long directory name is copied into the undersized stack buffer, causing 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.

A buffer is a fixed-size area of memory used to hold data. If a program copies more data into it than it can hold, the extra data spills over into nearby memory, which is called a buffer overflow. Here the program reserved space for 200 single-byte characters but the system filled it with 200 double-byte characters, so the data was twice as large as expected and overwrote other memory.

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