{"id":"MSF-multi--browser--java_jre17_exec","name":"Java 7 Applet Remote Code Execution","description":"The exploit takes advantage of two issues in JDK 7: The ClassFinder and MethodFinder.findMethod(). Both were newly introduced in JDK 7. ClassFinder is a replacement for classForName back in JDK 6. It allows untrusted code to obtain a reference and have access to a restricted package in JDK 7, which can be used to abuse sun.awt.SunToolkit (a restricted package). With sun.awt.SunToolkit, we can actually invoke getField() by abusing findMethod() in Statement.invokeInternal() (but getField() must be public, and that's not always the case in JDK 6) in order to access Statement.acc's private field, modify AccessControlContext, and then disable Security Manager. Once Security Manager is disabled, we can execute arbitrary Java code. Our exploit has been tested successfully against multiple platforms, including: IE, Firefox, Safari, Chrome; Windows, Ubuntu, OS X, Solaris, etc.","cves":["CVE-2012-4681"],"author":"Adam Gowdiak, James Forshaw, jduck, sinn3r, juan vazquez","published":"2012-08-26","platform":"Java,Linux,Windows","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/browser/java_jre17_exec.rb","path":"modules/exploits/multi/browser/java_jre17_exec.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"java_jre17_exec.rb","vulnerabilities":[{"id":"CVE-2012-4681","state":"PUBLISHED","title":null,"titleSource":null,"description":"Multiple vulnerabilities in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 6 and earlier allow remote attackers to execute arbitrary code via a crafted applet that bypasses SecurityManager restrictions by (1) using com.sun.beans.finder.ClassFinder.findClass and leveraging an exception with the forName method to access restricted classes from arbitrary packages such as sun.awt.SunToolkit, then (2) using \"reflection with a trusted immediate caller\" to leverage the getField method to access and modify private fields, as exploited in the wild in August 2012 using Gondzz.class and Gondvv.class.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2012-4681","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-2012-4681"},"updatedAt":"2026-08-06T03:55:26.322Z","retrievedAt":"2026-11-26T13:25:34.048Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--browser--java_jre17_exec.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--browser--java_jre17_exec","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--browser--java_jre17_exec/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--browser--java_jre17_exec/code","licenseUrl":"https://exploitbin.com/sources#metasploit"}