-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IncompleteAnnotationException when testing with OpenJDK 1.8.0_72 #17
Comments
Actually the same thing is happening with Oracle JDK 1.8.0_73.
|
I'll try to reproduce this when I have time. They may have done further gadget hardening that breaks these. |
It does look like there were more significant changes made to There's a good chance this was hardening against these sorts of attacks and it will probably require a more significant time investment to fix. |
For the Commons Collection this should work:
|
Seems to work for me. Although the Unit test doesn't pass for some reason. Submitted PR anyway: |
Looks like it does indeed work and it appears that the test failure is caused by a check for a null private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
ObjectInputStream.GetField gf = ois.readFields();
Object valObj = gf.get("val", null);
if (valObj == null) {
val = null;
} else if (valObj instanceof String) {
val= valObj;
} else if (System.getSecurityManager() == null // <----------------------------- HERE
|| valObj instanceof Long
|| valObj instanceof Integer
|| valObj instanceof Float
|| valObj instanceof Double
|| valObj instanceof Byte
|| valObj instanceof Short
|| valObj instanceof Boolean) {
val = valObj.toString();
} else { // the serialized object is from a version without JDK-8019292 fix
val = System.identityHashCode(valObj) + "@" + valObj.getClass().getName();
}
} The observer effect strikes again. Looks like we'll need to figure out a more robust way of detecting successful execution while testing this stuff and I'm definitely open to ideas. |
I hava changed the environment to openjdk 1.7.0, but the error also occurs.
|
@jasinner ask a stupid question, if you can't generate the jar package by |
add
|
👍 It works now! And I can see the exist of /tmp/pwned. Great job! |
Using a ConcurrentHashMap might be the saver solution ...
|
I'm getting the following stack trace when running the test cases with OpenJDK 1.8.0_72:
java.lang.Override missing element getType java.lang.annotation.IncompleteAnnotationException: java.lang.Override missing element getType at sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:81) at org.springframework.core.$Proxy13.getType(Unknown Source) at org.springframework.core.SerializableTypeWrapper$MethodInvokeTypeProvider.readObject(SerializableTypeWrapper.java:403) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1058) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1900) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371) at ysoserial.Deserializer.deserialize(Deserializer.java:27)
The text was updated successfully, but these errors were encountered: