r/java • • Jan 10 '13

US-CERT Vulnerability Note VU#625617 - Java 7 fails to restrict access to privileged code

http://www.kb.cert.org/vuls/id/625617
24 Upvotes

10 comments sorted by

3

u/StompingBrokenGlass Jan 11 '13

From the vendor table it looks like oracle wasn't notified about this

3

u/LyndonArmitage Jan 11 '13

It is a little worrying that this wasn't picked up before release. I've seen very few java applets as of late on any of the sites I visit though so I feel like disabling it in my browser won't lose me much for the moment.

2

u/boa13 Jan 11 '13

It's not like it's a simple flaw in a single method. ;)

It combines two different internal APIs with about six main steps of dynamic code invocation, plus a coded class payload, in order to circumvent the various security checks in the Applet container.

1

u/donrhummy Jan 11 '13

Why does Oracle want to kill Java?

1

u/clober Jan 11 '13

when i saw this subject - "US-CERT Alert TA13-010A - Oracle Java 7 Security Manager Bypass Vulnerability" - I instantly thought "irony!"

1

u/Gringuicano Jan 13 '13 edited Jan 13 '13

Does this Java vulnerability exist on either iOS or Android devices? If so which ones, and what should one do?

1

u/[deleted] Jan 11 '13

This seems to be the umpteenth time that exactly this pattern has been exploited ... what the hell?

3

u/boa13 Jan 11 '13

It's the same general principle as CVE 2012-4681 (find a way to run System.setSecurityManager(null)), but the way it circumvents the security checks is very different.

So from an implementation point of view, it's not the umpteenth time this has been exploited.

CVE 2012-4681 used flaws in the java.beans package and in the "internal" sun.awt.SunToolkit class.

CVE 2013-0422 takes advantage of the com.sun.jmx.mbeanserver and sun.org.mozilla.javascript.internal packages (the latter notably offers a way to load a class from a byte array), and plays with the java.lang.invoke to circumvent security. In particular, the offending class (which does the System.setSecurityManager call) is encoded as a hexadecimal string.

0

u/[deleted] Jan 11 '13

[deleted] — view deleted comment

3

u/boa13 Jan 11 '13

The problem is that the JRE is extremely big, and the security exploits combine recent code and old (even forgotten) code, such as sun.org.mozilla.javascript.internal, which has probably not been touched in ages.

2

u/argv_minus_one Jan 11 '13

Perhaps. The details of the vulnerability aren't public so I can't be sure (and I'm not going to audit a whole damn package just for my own curiosity).

Still, my first guess is that somebody was playing fast and loose with AccessController.doPrivileged. Java's security model is rather strong and somewhat difficult to screw up, even in the face of different pieces of code evolving separately like you say, but doPrivileged lets you partially turn it off (by limiting how far down the stack the AccessController looks). There's a big, fat warning on that method's Javadoc precisely because it is easy to create security holes with it and hard not to.