Firefox  (in)SecurityPrasanna K Dead Pixel
What  & Who This presentation demonstrates strength of the Mozilla platform and  how some of the features could be Mis-Used by malicious users. This presentation is intended to dispel a common MythFIREFOX is SECURE
FirefoxBrowser of the choice for  millions Multi Platform Modular and Scalable ! Pluggable Extension Code ! Browser of my Choice 
AgendaIntroductionMozilla PlatformAttacking Firefox        Malicious ExtensionsXCSSome basic points to watch….That’s All Folks …
Introduction
Extension Security !Mozilla extension security model is non-existent Extension code is fully trusted by FirefoxVulnerability in extension code might result in full system compromiseNo security boundaries between extensions An extension can silently modify/alter another extension
Mozilla Platform Chrome: It could be used to indicate a “Special Trusted Zone” within the Mozilla Platform
Mozilla Platform XUL (pronounced "zool") : Mozilla's XML-based language that lets you build feature-rich cross platform applications that can run connected or disconnected from the Internet. <?xml version="1.0"?><?xml-stylesheethref="chrome://global/skin/" type="text/css"?><window id="vbox example" title="Example 3...."xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">  <vbox>    <button id="yes" label="Yes"/>    <button id="no" label="No"/>    <button id="maybe" label="Maybe"/>  </vbox></window>
Mozilla Platform XBL:XML-based markup language used to declare the behavior and look of XUL-widgets and XML elements.scrollbar { -moz-binding: url('somefile.xml#binding1'); }--  “binding1” is the id of the binding
Mozilla Platform XPCOM:Cross platform component model from Mozilla.Nerve center of the Mozilla platform.XPCOM  has some Similarity to CORBA and Microsoft COM.
Important Components of Mozilla Platform
Mozilla Platform
Attacking Firefox !Now that we have seen the basic Architecture now for some Fun 
ExtensionsExtensions Add functionality to Firefox, Thunderbird and Sea-monkey.Sample Files inside a XPI fileexampleExt.xpi:              /install.rdf                                 /components/*                /components/cmdline.js                                 /defaults/              /defaults/preferences/*.js                   /plugins/*                                      /chrome.manifest              /chrome/icons/default/*                     /chrome/              /chrome/content/
Malicious ExtensionsWe will build a Malicious Extension which will Log all Key Strokes and Send RemotelyExecute Native CodeCrack Stored passwords Add malicious site to No Script.DEMO
Interesting FindsIn Course of this presentation I found some interesting finds some have been previously discussed but here they are again !
XCSCross Context Scripting is art of injecting malicious content into trusted Chrome Zone.
XCS injections occur from untrusted to trusted zone.
PDP was the first person to exploit XCS. Attacking Event & DOM Handlers Events Handlers implement Element properties attributes and Behavior.
DOM Nodes when Dragged and Dropped move the properties attributes and behavior
A extension that trusts copied DOM content be can be subverted by sending malicious content
CreateEvent() DOM function can be used to send malicious content to the extensionDEMO
Bypassing WrappersMultiple wrappers exist in Firefox and are used to protect privileged interfaces, functions and objects.
 wrappedJSObject can be used to strip the wrapper protection.DEMO
XBL Injection  Extends the functionality of elements.
When an extension makes use of bindings, elements within the bindings are attached to the invoking page.

Firefox (in)Security

  • 1.
  • 2.
    What &Who This presentation demonstrates strength of the Mozilla platform and how some of the features could be Mis-Used by malicious users. This presentation is intended to dispel a common MythFIREFOX is SECURE
  • 3.
    FirefoxBrowser of thechoice for millions Multi Platform Modular and Scalable ! Pluggable Extension Code ! Browser of my Choice 
  • 4.
    AgendaIntroductionMozilla PlatformAttacking Firefox Malicious ExtensionsXCSSome basic points to watch….That’s All Folks …
  • 5.
  • 6.
    Extension Security !Mozillaextension security model is non-existent Extension code is fully trusted by FirefoxVulnerability in extension code might result in full system compromiseNo security boundaries between extensions An extension can silently modify/alter another extension
  • 7.
    Mozilla Platform Chrome:It could be used to indicate a “Special Trusted Zone” within the Mozilla Platform
  • 8.
    Mozilla Platform XUL(pronounced "zool") : Mozilla's XML-based language that lets you build feature-rich cross platform applications that can run connected or disconnected from the Internet. <?xml version="1.0"?><?xml-stylesheethref="chrome://global/skin/" type="text/css"?><window id="vbox example" title="Example 3...."xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <button id="yes" label="Yes"/> <button id="no" label="No"/> <button id="maybe" label="Maybe"/> </vbox></window>
  • 9.
    Mozilla Platform XBL:XML-basedmarkup language used to declare the behavior and look of XUL-widgets and XML elements.scrollbar { -moz-binding: url('somefile.xml#binding1'); }-- “binding1” is the id of the binding
  • 10.
    Mozilla Platform XPCOM:Crossplatform component model from Mozilla.Nerve center of the Mozilla platform.XPCOM has some Similarity to CORBA and Microsoft COM.
  • 11.
    Important Components ofMozilla Platform
  • 12.
  • 13.
    Attacking Firefox !Nowthat we have seen the basic Architecture now for some Fun 
  • 14.
    ExtensionsExtensions Add functionalityto Firefox, Thunderbird and Sea-monkey.Sample Files inside a XPI fileexampleExt.xpi: /install.rdf /components/* /components/cmdline.js /defaults/ /defaults/preferences/*.js /plugins/* /chrome.manifest /chrome/icons/default/* /chrome/ /chrome/content/
  • 15.
    Malicious ExtensionsWe willbuild a Malicious Extension which will Log all Key Strokes and Send RemotelyExecute Native CodeCrack Stored passwords Add malicious site to No Script.DEMO
  • 16.
    Interesting FindsIn Courseof this presentation I found some interesting finds some have been previously discussed but here they are again !
  • 17.
    XCSCross Context Scriptingis art of injecting malicious content into trusted Chrome Zone.
  • 18.
    XCS injections occurfrom untrusted to trusted zone.
  • 19.
    PDP was thefirst person to exploit XCS. Attacking Event & DOM Handlers Events Handlers implement Element properties attributes and Behavior.
  • 20.
    DOM Nodes whenDragged and Dropped move the properties attributes and behavior
  • 21.
    A extension thattrusts copied DOM content be can be subverted by sending malicious content
  • 22.
    CreateEvent() DOM functioncan be used to send malicious content to the extensionDEMO
  • 23.
    Bypassing WrappersMultiple wrappersexist in Firefox and are used to protect privileged interfaces, functions and objects.
  • 24.
    wrappedJSObject canbe used to strip the wrapper protection.DEMO
  • 25.
    XBL Injection Extends the functionality of elements.
  • 26.
    When an extensionmakes use of bindings, elements within the bindings are attached to the invoking page.

Editor's Notes

  • #11 Xp Connect is the scripting front end to underlying Xpcom interfaces
  • #15 Introduction to extensions
  • #16 Xp Connect is the scripting front end to underlying Xpcom interfaces
  • #17 Discuss about Z:\\
  • #18 Xp Connect is the scripting front end to underlying Xpcom interfaces