Docsity

Java Security: Trusting Downloaded Code & Bytecode Verification - Prof. Jeffrey S. Foster, Study notes of Programming Languages

Partial preview of the text

Download Java Security: Trusting Downloaded Code & Bytecode Verification - Prof. Jeffrey S. Foster and more Study notes Programming Languages in PDF only on Docsity!

CMSC 433 – Programming Language

Technologies and Paradigms

Spring 2004

Security

April 22, 2004

2

So You Want to Download Code

  • What if code does bad things?
    • rm .
  • Solution 1: Trust everyone
    • Not such a good idea

3

So You Want to Download Code

  • Solution 2: Trust certain parties
    • E.g., Microsoft, Apple, RedHat
    • Often code will be signed
      • Very hard to impersonate trusted party
  • Solution 3: Limit your trust
    • Download anyone’s code, but...
    • Limit what it can do 4

Java Byte Code

  • javac compiles .java files to .class files
    • .class files contain java byte code
  • Suppose you download a .class file
    • javac prevents many kinds of errors, but
    • How do you know .class file came from javac?
      • You don’t!
    • Need to re-check that .class files are “type safe”

7

JDK 1.0 Security Model

(from java.sun.com 1.2 Security tutorial) 8

Sandboxing

  • Remote code runs in “safe” environment
    • Can’t do much harm
    • Unix example: chroot
  • Local programs have full access
    • Outside the sandbox

9

JDK 1.1 Security Model

(from java.sun.com 1.2 Security tutorial) 10

Limitations of 1.0/1.1 Solutions

  • 1.0: Remote code can do almost nothing
  • 1.1: All or nothing trust
    • One-size fits all solution not good enough
    • Need to support various security policies