vendredi 12 juillet 2019

Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')

This call to java.lang.Class.forName() uses reflection in an unsafe manner. An attacker can specify the class name to be instantiated, which may create unexpected control flow paths through the application. Depending on how reflection is being used, the attack vector may allow the attacker to bypass security checks or otherwise cause the application to behave in an unexpected manner. Even if the object does not implement the specified interface and a ClassCastException is thrown, the constructor of the untrusted class name will have already executed. The first argument to forName() contains tainted data. The tainted data originated from an earlier call to AnnotationVirtualController.vc_taintobj.

Action action = (Action)Class.forName("com.att.nis.esbcaspr.actions." esbAfDataContext.getFlowToProcess() + "Action").newInstance();


action.execute(EsbEventNotification, esbAfDataContext);

Validate the class name against a combination of white and black lists to ensure that only expected behavior is produced.





Aucun commentaire:

Enregistrer un commentaire