Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security SecProg
[Top] [All Lists]

Re: Java Inner Classes Insecure?

Subject: Re: Java Inner Classes Insecure?
Date: Fri, 26 Nov 2004 11:19:16 +0100
* Craig E. Ward wrote on Wed, Nov 24, 2004 at 10:33 -0800:
What these compilers do is add new static access methods that the 
inner classes can call to do things with the private members of the 
outer class. The inner class gets an extra member that is a reference 
to the outer class so it knows which instance of the outer class it 
belongs to.

Although I haven't actually made it work, it seems to me that calls 
to these access methods used by the inner classes could be inserted 
into third party classes. Does anyone know of a case where this has 
been done? Are the problems with inner classes historical or do they 
still exist?

Why is this of interest? In languages compiled to a platform you
can call private methods as well (using a debugger for instance),
if you manage it to modify the loaded code (or parts of it before
loading). I think this is the same here, isn't it?

The counter argument asserts that what this really shows is that the 
Java language is treating all class members orthogonally, which is a 
good thing. A class member is a class member. (In C++, inner classes 
do not get this access to the outer class automatically. This is an 
indicator that C++ is less orthogonal in its treatment of class 
members and this is a weakness in the language.)

Why should an inner class get implicit access to an outer class?
Any why do you call this dependency as orthogonality? The inner
class is visible in a smaller scope, but that's it I think. A
member should not know to which class it belongs (which also
fails for pointers - or should a pointer know to which instance
it belongs? And an int?). Did I missunderstood the point?

oki,

Steffen

-- 
Dieses Schreiben wurde maschinell erstellt,
es trägt daher weder Unterschrift noch Siegel.

<Prev in Thread] Current Thread [Next in Thread>