Jump to content
Nytro

CVE-2014-1824 – A New Windows Fuzzing Target

Recommended Posts

Posted

CVE-2014-1824 – A New Windows Fuzzing Target

Posted November 25, 2014 BeyondTrust Research Team

As time progresses, due to constant fuzzing and auditing many common Microsoft products are becoming reasonably hard targets to fuzz and find interesting crashes. There are two solutions to this: write a better fuzzer (american fuzzy lop) or pick a less audited target.

In a search for less audited attack surface, we are brought to MS14-038, Vulnerability in Windows Journal Could Allow Remote Code Execution (2975689). Before we start attacking this application, we would like to understand the vulnerability addressed by MS14-038.

Windows Journal is a tablet component shipped with Windows Vista forward, meant for taking notes and such. It has a file association of ‘.jnt’.

The bulletin doesn’t give too much information, but reveals the problem is some kind of parsing issue. The patch seems to address issues in NBDoc.dll, so let’s look at the bindiff of pre/post patch.

1_changed.png

The diff is ugly, many functions have changed and a few have been added/removed. So where do we go from here? Looking at the individual changes, we come across a few fixes that look security related, but after numerous dead-ends, one is more attractive than the rest – sub_2ECE0B90. A high level view of this function is seen below.

2_InterestingFunciton.png

This function is somewhat big and has quite a few changes, but is interesting for a couple reasons:

First off, apart from some structural changes, there are several calls to memcpy in the unpatched function. Only one of these has been converted to a memcpy_s in the patched function, the count of which is now passed in as an argument to the function.

4_why_intersting_0.png

Secondly, the function looks like it contains some kind of magic value at the top. In the very first basic block, further processing is determined by a call to strncmp, searching for the string “PTC+MSHM”. Perhaps this could be a useful marker for which to search.

3_why_interseting2.png

Assuming that this string is in fact a marker for a path to the vulnerable function we perform a quick Google search.

5_gotresults.png

After digging around on archive-ro.com, we end up with a link to a journal file:

http://www.phys.ubbcluj.ro/~vasile.chis/cursuri/info/c1.jnt

Popping this guy open in a hex editor, we get dozens of hits for PTC+MSHM on a free text search

6_ptc_marker.png

We now proceed dynamically, attempting to trigger a breakpoint in the affected function. We set one in the first block of the function of the unpatched DLL near the call to strncmp on “PTC+MSHM”. Upon hitting it the first time it, the str1 argument looks like this:

first_bp_hit.png

Grabbing all the bytes up till the second occurrence of 0f61 and flipping the endian, we get two hits in our hex editor, one at offset 0x04df and one at offset 0x2bcb.

file_hex_edit_1.png

The second hit is different from the dump, lacking the next word 0b70. So it looks like we are handling this blob at offset 0x04df in the file during the first function call.

Continuing on, we set a breakpoint above the memcpy of interest at the top of the block. After some stepping we get to this situation:

second_bp_hit.png

Well, that 0x0b70 looks familiar… Furtermore, it appears to be pushed as the size parameter to the memcpy. Let’s modify the initial file, changing 700B to FFFF.

source_of_size.png

Restarting the application and opening our modified file, we receive an access violation.

b00m.png

So as hoped, we crash in the memcpy and have exercised the vulnerable code. More than this particular vulnerability we are trying to isolate, this crash seems like it may be more indicative of less audited code then, say, MS Word.

With visions of unbounded memcpy’s in our eyes, we fired a dumb fuzzer at the current version of Journal – and as expected it fell over pretty quickly and in several unique ways — we encourage you to do the same.

Sursa: CVE-2014-1824 – A New Windows Fuzzing Target | BeyondTrust

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...