



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans
http://www.cs.virginia.edu/cs
PS6 Submission: Only to be eligible for the “Byte Code Wizard” awards. If the web submission is down, you can submit (once) by email.
UVa CS216 Spring 2006 - Lecture 19: Java Security 2
> java Simple Exception in thread "main" java.lang.VerifyError: (class: Simple, method: main signature: ([Ljava/lang/String;)V) Register 0 contains wrong type
.method public static main([Ljava/lang/String;)V … iconst_ istore_ aload_ iconst_ iconst_ iadd … return .end method
> java –noverify Simple result: 5
UVa CS216 Spring 2006 - Lecture 19: Java Security 3
> java –noverify Simple Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x809DCEB Function=JVM_FindSignal+0x1105F Library=C:\j2sdk1.4.2\jre\bin\client\jvm.dll Current Java thread: at Simple.main(Simple.java:7) …
.method public static main([Ljava/lang/String;)V … ldc 216 istore_ aload_ iconst_ iconst_ iadd … .end method
UVa CS216 Spring 2006 - Lecture 19: Java Security 4
Java VM Operating System Protected Resource
ClassLoader
Security exception
Verify Exception
JAR
Class
Verifier
UVa CS216 Spring 2006 - Lecture 19: Java Security 5
UVa CS216 Spring 2006 - Lecture 19: Java Security 6
UVa CS216 Spring 2006 - Lecture 19: Java Security 7
Monitor Program Speakers
SuperSoaker 2000 Disk (^) Memory
Network
UVa CS216 Spring 2006 - Lecture 19: Java Security 8
Monitor Program Speakers
SuperSoaker 2000 Disk (^) Memory
Network
Reference Monitor
UVa CS216 Spring 2006 - Lecture 19: Java Security 9
Can we build this? Probably not unless we can build a time machine...
UVa CS216 Spring 2006 - Lecture 19: Java Security 10
UVa CS216 Spring 2006 - Lecture 19: Java Security 11
UVa CS216 Spring 2006 - Lecture 19: Java Security 12
UVa CS216 Spring 2006 - Lecture 19: Java Security 19
UVa CS216 Spring 2006 - Lecture 19: Java Security 20
UVa CS216 Spring 2006 - Lecture 19: Java Security 21
UVa CS216 Spring 2006 - Lecture 19: Java Security 22
new #14 dup invokespecial #15
UVa CS216 Spring 2006 - Lecture 19: Java Security 23
Object Initialization Vulnerability [lsd-pl.net] class LSDbug extends SecurityClassLoader { public LSDbug() { try { LSDbug(5); } catch (SecurityException e) { this.loadClass(…); } } public LSDbug (int x) { super(); // throws Security Exception } }
this is used, but not property initialized! Bytecode verifier (old version) didn’t make correct checks
UVa CS216 Spring 2006 - Lecture 19: Java Security 24
Verifier (should be) Conservative
JVML programs
Safe programs
Verifiable programs
(Slide from Nate Paul’s ACSAC talk)
UVa CS216 Spring 2006 - Lecture 19: Java Security 25
JVML programs
Safe programs
Verifiable programs
Bug (Slide from Nate Paul’s ACSAC talk) UVa CS216 Spring 2006 - Lecture 19: Java Security 26
0
5
10
15
20
25
30
35
40
45
0 1 2 3 4 5 6 7 8 9
Vulnerabilities Reported
July 1996 Years Since First Release July 2005
UVa CS216 Spring 2006 - Lecture 19: Java Security 27
API bugs 10
DoS attacks (crash, consumption) 5
Configuration 4
Missing policy checks 3
Other or unknown 2
Class loading 8
Verification 12
several of these were because of jsr complexity UVa CS216 Spring 2006 - Lecture 19: Java Security 28
UVa CS216 Spring 2006 - Lecture 19: Java Security 29