secure web applications via automatic partitioning stephen chong, jed liu, andrew c. meyers, xin qi,...

25
Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Upload: wesley-french

Post on 27-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Secure Web Applications via Automatic Partitioning

Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian

Zheng, Xin Zheng.Cornell University

Page 2: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Outline

Introduction Swift Architecture Writing Swift Applications WebIL Swift Runtime Evaluation Conclusion

Page 3: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Introduction

Web applications are a critical part of today’s infrastructure

Page 4: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Introduction

Web applications account for 69% of internet vulnerabilities

Developer dilemma Performance vs security

Page 5: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Introduction Guess a number game

Confidentiality requirement Client cannot see number

Integrity requirement Client cannot affect number of guesses Only server can decide if guess is correct

Client side only implementation Best performance Client can cheat

Page 6: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Swift

Building web applications that are secure by construction

Automatic partitioning of code and data

Security critical code/data placed on server side only

Code/data placed on client side for performance

Page 7: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Swift Architecture

Jif Source Code WebIL WebIL Optimization Splitting Code JavaScript and Java Output Partitioning and Replication

Page 8: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Swift Architecture

Page 9: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Writing Swift Applications Extensions of Jif programming language Security policies expressed using labels

Confidentiality and Integrity policies Labels refer to principals

*(server) and client principals Compiler statically checks that

information flow is consistent with policies

Trust model Un trusted client Trusted server

Page 10: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Sample Policies

Page 11: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Guess a number Application

Page 12: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

WebIL Concerned with placement of code

and data Replace Jif labels with placement

annotations Placements chosen to optimize

responsiveness without sacrificing security

Partitioning solved as Integer programming problem

Page 13: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Placement Annotations

9 placement annotations

Page 14: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Guess-a-Number in WebIL

Page 15: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Partitioning Algorithm

Represent control flow as weighted directed graph Graph nodes are statements Edge weights are exec. frequencies

Integer programming problem Reduce to instance of max flow problem

Solution is placements of code/data

Page 16: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Partioning of Guess-a-Number

Page 17: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Swift Runtime Controls synchronization and

communication JavaScript runs on Client Java code runs on server

Asymmetric trust model Execution blocks Closures Activation Records

Page 18: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Execution Block

Methods divided into execution blocks Single entry Multiple exits Unique ids

Control transfer message Branch to block executing on different

host

Page 19: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Execution Blocks of Guess-a-Number

Page 20: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Activation Records

Execution blocks run in context of activation records

Client/server have different views of same activation record

Activation record updates forwarding between hosts

Security restrictions of forwarding

Page 21: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Closures

Next execution block id and activation record id

Stack of closures Correct simulation of method

calls/exceptions Integrity of control flow

Clients invoke high integrity closures in controlled way

Page 22: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Evaluation

Swift Compiler Jif compiler + 20K LOC Runtime system = 2.6K LOC

Six web applications implemented

Page 23: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Generated code size

Page 24: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Network messages

Page 25: Secure Web Applications via Automatic Partitioning Stephen Chong, Jed Liu, Andrew C. Meyers, Xin Qi, K. Vikram, Lantian Zheng, Xin Zheng. Cornell University

Conclusion

Constructing secure web applications

Automatic partitioning of functionality

Enforcement of information security policies

Programmer effort to add annotations