Security in Java Real or Decaf? cs205: engineering software

Slides:



Advertisements
Similar presentations
Mobile Code Security Yurii Kuzmin. What is Mobile Code? Term used to describe general-purpose executables that run in remote locations. Web browsers come.
Advertisements

Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Java security (in a nutshell)
Mobile Code Security Aviel D. Rubin, Daniel E. Geer, Jr. MOBILE CODE SECURITY, IEEE Internet Computing, 1998 Minkyu Lee
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
Extensibility, Safety and Performance in the SPIN Operating System Presented by Allen Kerr.
Breno de MedeirosFlorida State University Fall 2005 Buffer overflow and stack smashing attacks Principles of application software security.
1 CHAPTER 8 BUFFER OVERFLOW. 2 Introduction One of the more advanced attack techniques is the buffer overflow attack Buffer Overflows occurs when software.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
Java Security Updated May Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security.
JAVA v.s. C++ Programming Language Comparison By LI LU SAMMY CHU By LI LU SAMMY CHU.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
Security Exploiting Overflows. Introduction r See the following link for more info: operating-systems-and-applications-in-
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 19: Security in Java Real or.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
CS533 Concepts of Operating Systems Jonathan Walpole.
Class 14: Object-Oriented Programming Fall 2010 University of Virginia David Evans cs2220: Engineering Software.
Java Security Nathan Moore CS 665. Overview Survey of Java Inherent Security Properties Java Runtime Environment Java Virtual Machine Java Security Model.
Java 2 security model Valentina Casola. Components of Java the development environment –development lifecycle –Java language features –class files and.
What Is Java? According to Sun in a white paper: Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture-neutral, portable,
1 cs205: engineering software university of virginia fall 2006 Forgiveness and Permissions.
Computer Programming 2 Why do we study Java….. Java is Simple It has none of the following: operator overloading, header files, pre- processor, pointer.
Cs205: engineering software university of virginia fall 2006 Introducing Java David Evans Don’t forget to your registration.
Security Architecture and Design Chapter 4 Part 1 Pages 297 to 319.
Concurrency Properties. Correctness In sequential programs, rerunning a program with the same input will always give the same result, so it makes sense.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 18: Code Safety and Virtual Machines
CS 106 Introduction to Computer Science I 01 / 22 / 2007 Instructor: Michael Eckmann.
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 9: Designing Exceptionally.
David Evans CS588: Security and Privacy University of Virginia Computer Science Lecture 18: Malcode Countermeasures.
David Evans CS588: Cryptography University of Virginia Computer Science Lecture 21: Countering Malicious Code.
Lecture 4 Page 1 CS 111 Online Modularity and Memory Clearly, programs must have access to memory We need abstractions that give them the required access.
Software Security. Bugs Most software has bugs Some bugs cause security vulnerabilities Incorrect processing of security related data Incorrect processing.
1 cs205: engineering software university of virginia fall 2006 Running Untrustworthy Code Project team requests: extended until 11pm tonight.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Fundamental of Java Programming (630002) Unit – 1 Introduction to Java.
Mitigation against Buffer Overflow Attacks
Modularity Most useful abstractions an OS wants to offer can’t be directly realized by hardware Modularity is one technique the OS uses to provide better.
Introduction to Operating Systems
CMSC 345 Defensive Programming Practices from Software Engineering 6th Edition by Ian Sommerville.
Done By: Ashlee Lizarraga Ricky Usher Jacinto Roches Eli Gomez
Module 30 (Unix/Linux Security Issues II)
Chapter 1 Introduction to Computers, Programs, and Java
Lecture 1: Introduction to JAVA
CS216: Program and Data Representation
Programming Languages and Compilers (CS 421)
Java security (in a nutshell)
Exam Review.
Java programming lecture one
Introduction Enosis Learning.
Modularity and Memory Clearly, programs must have access to memory
Introduction Enosis Learning.
Introduction to Operating Systems
Lecture 18: Java™ Decaffeinated CS551: Security and Privacy
CS 465 Buffer Overflow Slides by Kent Seamons and Tim van der Horst
Java Byte Codes (0xCAFEBABE) cs205: engineering software
Concurring Concurrently
Chapter 14: Protection.
Object Oriented Programming
Byte Code Verification
From C++ to Java Java history: Oak, toaster-ovens, internet language, panacea What it is O-O language, not a hybrid (cf. C++) compiled to byte-code, executed.
Language-based Security
Java History, Editions, Version Features
Lecture 19: Proof-Carrying Code Background just got here last week
Review of Previous Lesson
M S COLLEGE ART’S, COMM., SCI. & BMS
Presentation transcript:

Security in Java Real or Decaf? cs205: engineering software university of virginia fall 2006 Security in Java Real or Decaf? (Duke suicide picture by Gary McGraw.)

Project Last problem set – final report is due last day of class Teams of 2-5: send me team requests before 11am Friday

Project Ideas Due next Wednesday For now, no suggestions – you can do anything you want, as long as it: Is small enough to finish by Dec 4 Is complex enough that a successful project will demonstrate understanding of and ability to apply key concepts in CS205 If you are really stuck...

Buzzword Description [Sun95] from Class 2... “A simple, object-oriented, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, and dynamic language.” [Sun95]

What is a secure programming language? Language is designed so it cannot express certain computations considered insecure. Language is designed so that (accidental) program bugs are likely to be caught by the compiler or run-time environment instead of leading to security vulnerabilities. A few attempt to do this: PLAN, packet filters

Safe Programming Languages Type Safety Compiler and run-time environment ensure that bits are treated as the type they represent Memory Safety Compiler and run-time environment ensure that program cannot access memory outside defined storage Control Flow Safety Can’t jump to arbitrary addresses Is Java the first language to have them? No way! LISP had them all in 1960.

Java Safety Type Safety Memory Safety Control Flow Safety Most types checked statically Coercions, array assignments type checked at run time Memory Safety No direct memory access (e.g., pointers) Primitive array type with mandatory run-time bounds checking Control Flow Safety Structured control flow, no arbitrary jumps

Malicious Code Can a safe programming language protect you from malcode? Code your servers in it to protect from buffer overflow bugs Only allow programs from untrustworthy origins to run if the are programmed in the safe language

Safe Languages? But how can you tell program was written in the safe language? Get the source code and compile it (most vendors, and all malicious attackers refuse to provide source code) Special compilation service cryptographically signs object files generated from the safe language (SPIN, [Bershad96]) Verify object files preserve safety properties of source language (Java)

JVML malcode.java malcode.class javac Java Compiler JVML Source Object Code JavaVM Alice User Alice wants to know JVML code satisfies Java’s safety properties.

Does JVML satisfy Java’s safety properties? No, we’ll learn some about JVML later...

Java Bytecode Verifier malcode.class JVML Object Code Trusted Computing Base Java Bytecode Verifier Invalid “Okay” Joe User STOP JavaVM

Bytecode Verifier Checks class file is formatted correctly Checks JVML code satisfies safety properties Simulates program execution to know types are correct, but doesn’t need to examine any instruction more than once

Verifying Safety Properties Type safe Stack and variable slots must store and load as same type Memory safe Must not attempt to pop more values from stack than are on it Doesn’t access private fields and methods outside class implementation Control flow safe Jumps must be to valid addresses within function, or call/return

Running Mistyped Code > java Simple Exception in thread "main" java.lang.VerifyError: (class: Simple, method: main signature: ([Ljava/lang/String;)V) Register 0 contains wrong type

Java Bytecode Verifier malcode.java javac Compiler malcode.class JVML Trusted Computing Base Java Bytecode Verifier Invalid Joe User “Okay” STOP JavaVM

Charge Next classes: understanding byte codes and the byte code verifier Start thinking about project ideas and teams Send team requests by email before 11am Friday