Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > how can a Java buffer overflow lead to arbitrary code execution?

Reply
Thread Tools

how can a Java buffer overflow lead to arbitrary code execution?

 
 
neuneudr@yahoo.fr
Guest
Posts: n/a
 
      02-02-2007
Hi,

there's something I don't get about a recent Java GIF decoder exploit.

I was under the impression that since Java existed there had never
been any
buffer overrun/overflow in Java programs. That the JVM explicitely
made that
impossible and that, should a buffer overflow happen, it would an
error in
the implementation of the particular JVM it'd affect, not a flaw in
the JVM sandbox
model.

Now I know we've already seen some issues (I remember, for example,
some
zlib decompression exploit, but it was a third-party, native C lib
that the JVM
depended on).

Here's the issue (it clearly says that it's a "buffer overrun") :

"Security Vulnerability in Processing GIF Images in the Java Runtime
Environment
May Allow an Untrusted Applet to Elevate Privileges"

http://www.sunsolve.sun.com/search/d...=1-26-102760-1

Does it mean that the GIF decoder is not written in Java ?

If the GIF decoder is written in Java, how can a buffer overrun
happen ?
(does it mean the sandbox model, which has been free of buffer overrun
since 10 years, is broken?)

Thanks in advance to anyone shedding light on this,

Driss

 
Reply With Quote
 
 
 
 
Daniel Pitts
Guest
Posts: n/a
 
      02-02-2007
On Feb 2, 8:10 am, neune...@yahoo.fr wrote:
> Hi,
>
> there's something I don't get about a recent Java GIF decoder exploit.
>
> I was under the impression that since Java existed there had never
> been any
> buffer overrun/overflow in Java programs. That the JVM explicitely
> made that
> impossible and that, should a buffer overflow happen, it would an
> error in
> the implementation of the particular JVM it'd affect, not a flaw in
> the JVM sandbox
> model.
>
> Now I know we've already seen some issues (I remember, for example,
> some
> zlib decompression exploit, but it was a third-party, native C lib
> that the JVM
> depended on).
>
> Here's the issue (it clearly says that it's a "buffer overrun") :
>
> "Security Vulnerability in Processing GIF Images in the Java Runtime
> Environment
> May Allow an Untrusted Applet to Elevate Privileges"
>
> http://www.sunsolve.sun.com/search/d...=1-26-102760-1
>
> Does it mean that the GIF decoder is not written in Java ?
>
> If the GIF decoder is written in Java, how can a buffer overrun
> happen ?
> (does it mean the sandbox model, which has been free of buffer overrun
> since 10 years, is broken?)
>
> Thanks in advance to anyone shedding light on this,
>
> Driss


It could be that more recent versions (the site you gave will tell you
what is effected) use native code to handle the (de)compression of GIF
files. Native code is exempt from most of Java's safeguards.

 
Reply With Quote
 
 
 
 
Chris Uppal
Guest
Posts: n/a
 
      02-05-2007
wrote:

> "Security Vulnerability in Processing GIF Images in the Java Runtime
> Environment
> May Allow an Untrusted Applet to Elevate Privileges"
>
> http://www.sunsolve.sun.com/search/d...=1-26-102760-1
>
> Does it mean that the GIF decoder is not written in Java ?


Like Daniel, I assume that the GIF decoder is actually written in something
like C, and invoked via JNI.

What bothers me about the security announcement is that it suggests that the
impact is limited to allowing applets to escape the sandbox. Unless there's
something about the problem that they are not mentioning, then it's a good deal
worse than that: it makes /any/ Java application which displays GIFs
potentially vulnerable to arbitrary code execution.

Ones that use Sun's decoder, anyway. And only ones that display, or can be
tricked into displaying, a maliciously-crafted GIF.

For instance (purely imaginary). A chat application which allows people to
send GIFs to each other to be used as "faces". Or another application which
uses downloadable "skins". Or an image catalogue program written in Java....


There's a better description of it here:
http://www.zerodayinitiative.com/adv...DI-07-005.html
Although that also seems to underestimate the scope somewhat.

-- chris



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Java Lead/ Lead Software Engineer -Immediate Requirement Ann Javascript 1 01-02-2008 04:34 AM
Java Lead/ Lead Software Engineer Ann Java 0 09-06-2007 09:55 AM
Sr.Developer / Team Lead / Proj Lead / Project Manager /Tech Lead for Datamatics Ltd., Mumbai supriyab17@gmail.com Java 0 11-22-2006 05:13 AM
calling an arbitrary function w/ arbitrary arguments Honestmath C++ 5 12-13-2004 06:18 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57