This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
public class Reflection { | |
public static void vulnerableMethod() { | |
} | |
public void reflectVulnerableMethod() throws ClassNotFoundException, NoSuchMethodException, SecurityException, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
VulnerableClass a = new VulnerableClass(1); | |
VulnerableClass b = new VulnerableClass(2); | |
a.equals(b); | |
HarmlessClass ha = new HarmlessClass(1); | |
HarmlessClass hb = new HarmlessClass(2); | |
ha.equals(hb); | |
Object oa = new VulnerableClass(1); |