Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Oracle mitigated this vulnerability in Java 1.7.0p11 by adding an access check to the loadClass() method. This access check ensures that the caller is permitted to access the class being sought.:

Code Block
bgColor#ccccff
langjava
// ...
    if (className == null) {
        throw new RuntimeOperationsException(new
            IllegalArgumentException("The class name cannot be null"),
                          "Exception occurred during object instantiation");
    }
    ReflectUtil.checkPackageAccess(className);
    try {
        if (loader == null)
// ...

...

Code Block
public static Class forName(String name, boolean initialize,  ClassLoader loader) /* explicitly specify the class loader to use */ throws ClassNotFoundException

Related Guidelines

...

Bibliography

...