A Secure Implementation of Java Inner Classes



Similar documents
Soving Recurrence Relations

Static revisited. Odds and ends. Static methods. Static methods 5/2/16. Some features of Java we haven t discussed

Domain 1: Designing a SQL Server Instance and a Database Solution

Engineering Data Management

(VCP-310)

.04. This means $1000 is multiplied by 1.02 five times, once for each of the remaining sixmonth

Desktop Management. Desktop Management Tools

Agenda. Outsourcing and Globalization in Software Development. Outsourcing. Outsourcing here to stay. Outsourcing Alternatives

Modified Line Search Method for Global Optimization

Lesson 15 ANOVA (analysis of variance)

Enhancing Oracle Business Intelligence with cubus EV How users of Oracle BI on Essbase cubes can benefit from cubus outperform EV Analytics (cubus EV)

Department of Computer Science, University of Otago

How to use what you OWN to reduce what you OWE

Domain 1: Configuring Domain Name System (DNS) for Active Directory

LECTURE 13: Cross-validation

CHAPTER 11 Financial mathematics

Finding the circle that best fits a set of points

A Combined Continuous/Binary Genetic Algorithm for Microstrip Antenna Design

NEW HIGH PERFORMANCE COMPUTATIONAL METHODS FOR MORTGAGES AND ANNUITIES. Yuri Shestopaloff,

Document Control Solutions

I. Why is there a time value to money (TVM)?

Chapter 5 Unit 1. IET 350 Engineering Economics. Learning Objectives Chapter 5. Learning Objectives Unit 1. Annual Amount and Gradient Functions

Automatic Tuning for FOREX Trading System Using Fuzzy Time Series

CHAPTER 3 THE TIME VALUE OF MONEY

Ekkehart Schlicht: Economic Surplus and Derived Demand

DAME - Microsoft Excel add-in for solving multicriteria decision problems with scenarios Radomir Perzina 1, Jaroslav Ramik 2

Cooley-Tukey. Tukey FFT Algorithms. FFT Algorithms. Cooley

Now here is the important step

Ranking Irregularities When Evaluating Alternatives by Using Some ELECTRE Methods

Lecture 2: Karger s Min Cut Algorithm

Output Analysis (2, Chapters 10 &11 Law)

A probabilistic proof of a binomial identity

Present Value Factor To bring one dollar in the future back to present, one uses the Present Value Factor (PVF): Concept 9: Present Value

The Power of Free Branching in a General Model of Backtracking and Dynamic Programming Algorithms

2-3 The Remainder and Factor Theorems

COMPARISON OF THE EFFICIENCY OF S-CONTROL CHART AND EWMA-S 2 CONTROL CHART FOR THE CHANGES IN A PROCESS

Evaluation of Different Fitness Functions for the Evolutionary Testing of an Autonomous Parking System

IT Support n n support@premierchoiceinternet.com. 30 Day FREE Trial. IT Support from 8p/user

Bond Valuation I. What is a bond? Cash Flows of A Typical Bond. Bond Valuation. Coupon Rate and Current Yield. Cash Flows of A Typical Bond

THE ARITHMETIC OF INTEGERS. - multiplication, exponentiation, division, addition, and subtraction

Quantitative Computer Architecture

The analysis of the Cournot oligopoly model considering the subjective motive in the strategy selection

Chapter 6: Variance, the law of large numbers and the Monte-Carlo method

Domain 1: Identifying Cause of and Resolving Desktop Application Issues Identifying and Resolving New Software Installation Issues

Project Deliverables. CS 361, Lecture 28. Outline. Project Deliverables. Administrative. Project Comments

Traffic Modeling and Prediction using ARIMA/GARCH model

C.Yaashuwanth Department of Electrical and Electronics Engineering, Anna University Chennai, Chennai , India..

Simple Annuities Present Value.

Infinite Sequences and Series

INVESTMENT PERFORMANCE COUNCIL (IPC) Guidance Statement on Calculation Methodology

5.4 Amortization. Question 1: How do you find the present value of an annuity? Question 2: How is a loan amortized?

FM4 CREDIT AND BORROWING

Sole trader financial statements

Systems Design Project: Indoor Location of Wireless Devices

Evaluating Model for B2C E- commerce Enterprise Development Based on DEA

Research Article Sign Data Derivative Recovery

Caché SQL Version F.12 Release Information

Developing the Application of 360 Degree Performance Appraisal through Logic Model

Configuring Additional Active Directory Server Roles

Composable Tools For Network Discovery and Security Analysis

Authentication - Access Control Default Security Active Directory Trusted Authentication Guest User or Anonymous (un-authenticated) Logging Out

Routine for 8-Bit Binary to BCD Conversion

ODBC. Getting Started With Sage Timberline Office ODBC

Taking DCOP to the Real World: Efficient Complete Solutions for Distributed Multi-Event Scheduling

To c o m p e t e in t o d a y s r e t a i l e n v i r o n m e n t, y o u n e e d a s i n g l e,

Lesson 17 Pearson s Correlation Coefficient

AP Calculus AB 2006 Scoring Guidelines Form B

e-trader user guide Introduction

A Balanced Scorecard

3. Greatest Common Divisor - Least Common Multiple

Digital Enterprise Unit. White Paper. Web Analytics Measurement for Responsive Websites

Time Value of Money, NPV and IRR equation solving with the TI-86

Chatpun Khamyat Department of Industrial Engineering, Kasetsart University, Bangkok, Thailand

Best of security and convenience

5 Boolean Decision Trees (February 11)

Handling. Collection Calls

Bio-Plex Manager Software

where: T = number of years of cash flow in investment's life n = the year in which the cash flow X n i = IRR = the internal rate of return

I apply to subscribe for a Stocks & Shares ISA for the tax year 20 /20 and each subsequent year until further notice.

Estimating Probability Distributions by Observing Betting Practices

Supply Chain Management

Sequences and Series Using the TI-89 Calculator

Chapter 10 Computer Design Basics

RUT - development handbook 1.3 The Spiral Model v 4.0

Optimize your Network. In the Courier, Express and Parcel market ADDING CREDIBILITY

Chair for Network Architectures and Services Institute of Informatics TU München Prof. Carle. Network Security. Chapter 2 Basics

CDs Bought at a Bank verses CD s Bought from a Brokerage. Floyd Vest

SECTION 1.5 : SUMMATION NOTATION + WORK WITH SEQUENCES

Design and Implementation of a Publication Database for the Vienna University of Technology

Transcription:

A Secure Implemetatio of Java Ier Classes By Aasua Bhowmik ad William Pugh Departmet of Computer Sciece Uiversity of Marylad More ifo at: http://www.cs.umd.edu/~pugh/java

Motivatio ad Overview Preset implemetatio of Java ier classes provides a security hole i order to allow ier classes access the private fields of the outer class ad vice versa We desiged a secure techique for allowig access to private fields ad methods No eed to chage the JVM Very little overhead Developed a byte code trasformig tool which modify the class files ad make the ier classes safe

Java Ier Classes Ier class is a ew feature added i Java 1.1 Ier classes are classes defied as member of other class Ier classes are allowed to access the private members of the eclosig class ad vice versa For each istace of a outer class there is a correspodig istace of the ier classes class A { private a; class B { private b; void f() { b = a+a; // accessig pvt. var of A public g(){ B myobj = ew B(); myobj.f(); it x = myobj.b; // accessig pvt. var of A

Ier Classes AreÕt Uderstood By JVMs Ier classes are implemeted as a compiler trasformatio JVM do ot eed to uderstad ier classes Ð code will ru o 1.0 JVMÕs JVM prohibits access to private members from outside the class Compiler trasforms the class, cotaiig ier classes, to a umber of o-ested classes

Implemetatio of Ier Classes class A class A private it m; private class B { private it x; void f(){ x = m; public void g(){ B ob = ew B(); ob.f(); After compilatio private it m; public void g() { A$B ob = ew A$B(); ob.f(); it access$0() { retur m; class A$B A this$0; private it x; void f(){ x = this$0.access$0(); Access$0() of class A has package level visibility. The class A$B also has package level visibility

Security Threats with Preset Implemetatio The private data members of classes get exposed through access fuctios Other classes belogig to the same package ca call the access fuctios ad tamper the private data member fu(){ A a = ew A();.. it x = a.access$0(); Class C Udesired access Class C ad A belogs to the same package Class A private it m; public void g() { A$B ob = ew A$B(); ob.f(); it access$0() { retur m;

Is This A Problem? Lots of Java code uses ier classes Usig ew 1.2 security model, all privileged code is put i ier classes Still requires attacker get iside package Oe security barrier dow Ð Prefer defese i depth Ed Felto recommeds agaist usig curret versio of ier classes

New Implemetatio of Ier Classes The access to the private members are restricted oly to the iteded classes The ew implemetatio is built o top of the curret implemetatio Ð class files are rewritte No eed to chage the JVM A secret key is shared betwee all the classes that eed access to each others private data members Ð Class B wats to access a class AÕs private member m Ð ivokes AÕs access fuctio Ð B passes itõs shared secret key to AÕs access fuctio Ð A verifies whether BÕs secret key ad AÕs secret key are the same object if yes, give access to its private variable m otherwise, throw a security exceptio

New Implemetatio of Ier Classes The secret key is a object allocated dyamically durig ru time. Class A allocates a object i its static iitializer ad stores it i its ow private static field A.sharedSecret Class A passes dow the secret key by ivokig the receivesecretkey(a.sharedsecret) of class B I receivesecretkey(object) B stores AÕs secret key i itõs ow private static field, B.sharedSecret Wheever B tries to access AÕs private field it passes itõs shared secret key for autheticatio

New Implemetatio of Ier Classes Iitializatio Phase A allocates a ew object ad stores it i A.sharesSecret B wats to access AÕs private Field B ivokes AÕs access method with B.sharedSecret as a argumet A passes the secret key object to B B passes the secret key for verificatio B stores the secret key passed by A i B.sharedSecret A throws security exceptio if secret keys ot match I access method A verifies BÕs secret key A grats access if BÕs secret key matches with AÕs

Class A { static private fial Object sharedsecret = ew Object(); static { A$B.receiveSecretForA(sharedSecret); private it x; it access$1(object secretfora) { if (secretfora!=sharedsecret) throw retur x; ew SecurityExceptio(); Class A$B { private A this$0; static private Object sharedsecret; static void receivesecretfora(object secretkey) { if (sharedsecret!= ull) throw ew VerifyError(); sharedsecret = secretkey; É ivoke this$0.access$1(sharedsecret)é

Advatages of the New Implemetatio Access is permitted oly to the desired classes No eed to chage the existig JVMs The secret key value is a poiter to memory, allocated dyamically Ð Absolutely impossible to forge The additioal overhead for iitializatio ad validatio of the secret keys are small Very small icrease i the size of the class files

Overhead Due to Modificatio For each class allowig/eedig access Ð Oe static field For each set of objects eedig mutual access Ð Oe object created All iitializatios are doe i static iitializer Oe additioal argumet i each access$ method Few additioal istructios are executed for each access call to Ð pass the extra argumet Ð verify the secret key

A Rewritig Tool For Jar Files Developed a tool to trasform the byte codes Takes a jar file, examies the class files ad fids out the sets of classes which eed mutual access modify all the class files which are either defiig access$ methods or ivokig access$ methods All the classes i the jar file are made safe i the presece of ier classes Used our tool to modify several jar files - rt.jar, swig.jar etc.

Experimetal Result for swig.jar Static Evaluatio: % icrease i the code size - 2.9% # of class files i swig.jar - 1498 # of ier classes - 898 # of ier classes eedig access - 139 # of objects created - 53 # of ew fields added - 195 # of access methods - 145 # of places access methods are ivoked - 439

Experimetal Result for swig.jar Rutime Performace For a trial ru of SwigSet demo, which tests all the fuctioalities Total umber of calls to access$ fuctios - 46,638 Total user time - 59.44 sec Total system time - 3.91 sec Note: The user ad system times are comparable whe we ru the demo with origial swig.jar file. Although it is ot possible to ru the demo exactly the same way ad compare precisely

Eve Better Security Before A gives the secret to A$B Ð Check sigatures o A$B imply the sigatures o A Prevets situatio where a attacker tries to combie a siged versio of A with a modified ( ad usiged ) versio of A$B

Coclusio Desiged a ew implemetatio for ier classes to fix the security hole of the curret implemetatio Little additioal overhead Ð regardig both code size ad executio time Implemeted a byte code rewriter to icorporate the chages by trasformig the byte code Ca be implemeted i the compiler Ca exted this idea to have fried classes like C++