cve-2012-4681的分析记录
一、简介
cve-2012-4681是去年8月份爆出的java沙盒的漏洞。
漏洞是利用java的特性,从受限制的沙盒代码中调用系统信任的代码,间接修改了java.beans.Statement类的参数
--- a/src/share/classes/com/sun/beans/finder/MethodFinder.java Mon Aug 13 14:20:05 2012 -0700+++ b/src/share/classes/com/sun/beans/finder/MethodFinder.java Tue Jun 19 20:06:56 2012 +0400@@ -1,5 +1,5 @@ /*- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.+ * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it@@ -33,6 +33,8 @@ import java.lang.reflect.Type; import java.lang.reflect.Type; import java.util.Arrays; +import static sun.reflect.misc.ReflectUtil.isPackageAccessible;+ /** * This utility class provides {@code static} methods * to find a public method with specified name and parameter types@@ -120,7 +122,7 @@ public final class MethodFinder extends */ public static Method findAccessibleMethod(Method method) throws NoSuchMethodException { Class<?> type = method.getDeclaringClass();- if (Modifier.isPublic(type.getModifiers())) {+ if (Modifier.isPublic(type.getModifiers()) && isPackageAccessible(type)) { return method; } if (Modifier.isStatic(method.getModifiers())) {