Systems and Internet Infrastructure Security Laboratory (SIIS) Page 1
CMPSC 497: Java Security
Trent Jaeger Systems and Internet Infrastructure Security (SIIS) Lab Computer Science and Engineering Department Pennsylvania State University
CMPSC 497: Java Security Trent Jaeger Systems and Internet - - PowerPoint PPT Presentation
CMPSC 497: Java Security Trent Jaeger Systems and Internet Infrastructure Security (SIIS) Lab Computer Science and Engineering Department Pennsylvania State University Systems and Internet Infrastructure Security Laboratory (SIIS) Page 1
Systems and Internet Infrastructure Security Laboratory (SIIS) Page 1
Trent Jaeger Systems and Internet Infrastructure Security (SIIS) Lab Computer Science and Engineering Department Pennsylvania State University
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
harmful
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page 5
Threats Examples Java’s defense System modification delete files; kill processes; make network connections Strong Invasion of privacy Steal passwords, data strong Denial of service Using up memory, CPU cycles; Completely filling up a file system; weak Antagonism Playing annoying sound weak
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Java Compiler Front End Bytecode (class files) Java Source
GC
Bytecode Verifier
Security manager
Class Loader
constant pool
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
*From ”Securing Java” by McGraw and Felten
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
to the stack
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
0: iconst_1 //push the integer 1 1: istore_1 //store it in register 1 (the res variable) 2: iload_0 //push register 0 (the n parameter) 3: ifle 16 //if negative or 0, goto PC 16 6: iload_1 //push register 1 (the res variable) 7: iload_0 //push register 0 (the n parameter) 8: imul //perform multiplication 9: istore_1 //store it in register 1 10: iinc 0, -1 //decrement register 0 by 1 13: goto 2 //go to PC 2 16: iload_1 //load register 1 (res) 17: ireturn //return the value to caller
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
{0:int, 1:int}, stack:[] 0: iload_0 {0:int, 1:int}, stack: [int] 1: iload_1 {0:int, 1:int}, stack: [int, int] 2: iadd {0:int, 1:int}, stack: [int] 3: ireturn
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
0: iconst_1 //push the integer 1 1: istore_1 //store it in register 1 (the res variable) 2: iload_0 //push register 0 (the n parameter) 3: ifle 16 //if negative or 0, goto PC 16 6: iload_1 //push register 1 (the res variable) 7: iload_0 //push register 0 (the n parameter) 8: imul //perform multiplication 9: istore_1 //store it in register 1 10: iinc 0, -1 //decrement register 0 by 1 13: goto 2 //go to PC 2 16: iload_1 //load register 1 (res) 17: ireturn //return the value to caller
§
What happens
§
if “goto 2” is changed to “goto 5”?
§
if “istore_1” is omi9ed?
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
connections; …
the site where the applet is downloaded
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Idea: Every code (remote or local) has access to the system resources based on what is defined in a policy file
grant CodeBase “http://java.sun.com”, SignedBy “Sun” { permission java.io.FilePermission “${user.home}${/}*”, “read, write”; permission java.net.SocketPermission “localhost:1024-”, “listen”;}; JVM resources local or remote code (signed or unsigned)
class loaders policy file
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
public boolean delete() {
SecurityManager security = System.getSecurityManager(); if (security != null) { security.checkDelete(path); } if (isDirectory()) return rmdir0(); else return delete0(); }
checkDelete throws a SecurityExecption if the delete would violate the policy
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
grant CodeBase “http://java.sun.com”, SignedBy “Sun” { permission java.io.FilePermission “${user.home}${/}*”, “read, write”; permission java.net.SocketPermission “localhost:1024-”, “listen”;};
permissions and socket permissions
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Fig 8.9 “Enterprise Java Security”
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
write to a log file
Fig 8.2 “Enterprise Java Security”
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Systems and Internet Infrastructure Security Laboratory (SIIS) Page
Language