IFC Inside: Retrofitting Languages with Dynamic Information Flow Control Stefan Heule, Deian Stefan, Edward Z. Yang, John C. Mitchell, Alejandro Russo.

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

Microsoft Research March 20, 2000 A Programming Language for Developing Interactive Web Services Claus Brabrand BRICS, University of Aarhus, Denmark.
Cookies, Sessions. Server Side Includes You can insert the content of one file into another file before the server executes it, with the require() function.
Static and User-Extensible Proof Checking Antonis StampoulisZhong Shao Yale University POPL 2012.
Automatic Memory Management Noam Rinetzky Schreiber 123A /seminar/seminar1415a.html.
Mobile Code Security Aviel D. Rubin, Daniel E. Geer, Jr. MOBILE CODE SECURITY, IEEE Internet Computing, 1998 Minkyu Lee
CompSci Applets & Video Games. CompSci Applets & Video Games The Plan  Applets  Demo on making and running a simple applet from scratch.
Presented by Vaibhav Rastogi.  Advent of Web 2.0 and Mashups  Inclusion of untrusted third party content a necessity  Need to restrict the functionality.
An Evaluation of the Google Chrome Extension Security Architecture
Ashish Kundu CS590F Purdue 02/12/07 Language-Based Information Flow Security Andrei Sabelfield, Andrew C. Myers Presentation: Ashish Kundu
VeriML: Revisiting the Foundations of Proof Assistants Zhong Shao Yale University MacQueen Fest May 13, 2012 (Joint work with Antonis Stampoulis)
Java Security: From HotJava to Netscape & Beyond Drew Dean, Edward W. Felten, Dan S. Wallach Department of Computer Science, Princeton University May,
Lecture 2 Page 1 CS 236, Spring 2008 Security Principles and Policies CS 236 On-Line MS Program Networks and Systems Security Peter Reiher Spring, 2008.
The Most Dangerous Code in the Browser Stefan Heule, Devon Rifkin, Alejandro Russo, Deian Stefan Stanford University, Chalmers University of Technology.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Extensibility, Safety and Performance in the SPIN Operating System Bershad et al Presentation by norm Slides shamelessly “borrowed” from Stefan Savage’s.
1 Enforcing Confidentiality in Low-level Programs Andrew Myers Cornell University.
Russell Taylor Lecturer in Computing & Business Studies.
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
1 Type-Directed Concurrency Deepak Garg, Frank Pfenning {dg+, Carnegie Mellon University.
Automatic Implementation of provable cryptography for confidentiality and integrity Presented by Tamara Rezk – INDES project - INRIA Joint work with: Cédric.
Java Servlets. What Are Servlets? Basically, a java program that runs on the server Basically, a java program that runs on the server Creates dynamic.
Phu H. Phung Chalmers University of Technology JSTools’ 12 June 13, 2012, Beijing, China Joint work with Lieven Desmet (KU Leuven)
1 Subspace: Secure Cross Domain Communication for Web Mashups Collin Jackson and Helen J. Wang Mamadou H. Diallo.
D ATABASE S ECURITY Proposed by Abdulrahman Aldekhelallah University of Scranton – CS521 Spring2015.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
ADLB Update Recent and Current Adventures with the Asynchronous Dynamic Load Balancing Library Rusty Lusk Mathematics and Computer Science Division Argonne.
Using Data Active Server Pages Objectives In this chapter, you will: Learn about variables and constants Explore application and session variables Learn.
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
LAYING OUT THE FOUNDATIONS. OUTLINE Analyze the project from a technical point of view Analyze and choose the architecture for your application Decide.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
16-1 The World Wide Web The Web An infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that information.
Applets & Video Games 1 Last Edited 1/10/04CPS4: Java for Video Games Applets &
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
CS162 Week 8 Kyle Dewey. Overview Example online going over fail03.not (from the test suite) in depth A type system for secure information flow Implementing.
Containment and Integrity for Mobile Code Security policies as types Andrew Myers Fred Schneider Department of Computer Science Cornell University.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Protecting Internet Communications: Encryption  Encryption: Process of transforming plain text or data into cipher text that cannot be read by anyone.
JAVA SERVER PAGES. 2 SERVLETS The purpose of a servlet is to create a Web page in response to a client request Servlets are written in Java, with a little.
Native Client: A Sandbox for Portable, Untrusted x86 Native Code
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
CSCE 201 Web Browser Security Fall CSCE Farkas2 Web Evolution Web Evolution Past: Human usage – HTTP – Static Web pages (HTML) Current: Human.
Component Technology. Challenges Facing the Software Industry Today’s applications are large & complex – time consuming to develop, difficult and costly.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
SECURE WEB APPLICATIONS VIA AUTOMATIC PARTITIONING S. Chong, J. Liu, A. C. Myers, X. Qi, K. Vikram, L. Zheng, X. Zheng Cornell University.
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
Writing Systems Software in a Functional Language An Experience Report Iavor Diatchki, Thomas Hallgren, Mark Jones, Rebekah Leslie, Andrew Tolmach.
RUBRIC IP1 Ruben Botero Web Design III. The different approaches to accessing data in a database through client-side scripting languages. – On the client.
EXTENSIBILITY, SAFETY AND PERFORMANCE IN THE SPIN OPERATING SYSTEM
Lecture 16 Page 1 CS 236 Online Web Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Protecting Browsers from Extension Vulnerabilities Paper by: Adam Barth, Adrienne Porter Felt, Prateek Saxena at University of California, Berkeley and.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
JSP BASICS AND ARCHITECTURE. Goals of JSP Simplify Creation of dynamic pages. Separate Dynamic and Static content.
Qusay H. Mahmoud CIS* CIS* Service-Oriented Computing Qusay H. Mahmoud, Ph.D.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
Introduction Program File Authorization Security Theorem Active Code Authorization Authorization Logic Implementation considerations Conclusion.
Client-Server applications Introduction to Java Applets Client-server architectures Why do Applets exist? What can an Applet do?
CSE 60641: Operating Systems George C. Necula and Peter Lee, Safe Kernel Extensions Without Run-Time Checking, OSDI ‘96 –SIGOPS Hall of fame citation:
Lecture9 Page 1 CS 236 Online Operating System Security, Con’t CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Static Detection of Cross-Site Scripting Vulnerabilities
Cross-Site Request Forgeries: Exploitation and Prevention
Database Driven Websites
Building Systems That Flexibly Control Downloaded Executable Content
Presentation transcript:

IFC Inside: Retrofitting Languages with Dynamic Information Flow Control Stefan Heule, Deian Stefan, Edward Z. Yang, John C. Mitchell, Alejandro Russo Stanford University, Chalmers University

Motivating Example: Web Security Website uses check_strength(pw) from some library ▫Danger: the library could send the password to bad.com ▫Website author has little control over this [Van Acker et al., CODASPY’15]

Web Security Today Code written by many different parties ▫Potentially mutually distrusting parties (website code, utility/framework libraries, advertising code, …) ▫Computing over sensitive data (passwords, healthcare information, banking data)

Possible Solution: IFC Information flow control … ▫… tracks where information flows ▫… allows policies to restrict flows of information In the example ▫Label password as sensitive ▫Restrict its dissemination (e.g. to arbitrary webservers)

What kind of IFC? Various trade-offs in IFC systems ▫Dynamic vs static ▫What kind of labels ▫Granularity at with information is tracked Sweetspot: dynamic, coarse-grained IFC

Coarse-grained IFC The program is split into computational units (tasks) ▫All data within one task has a single label Different computational units can communicate

This Talk Given an existing programming language, how can we add dynamic IFC? Minimal changes to language ▫Simplifies implementation Formal security guarantees

Approach Overview Given a target language ▫Any programming language for which we can control external effects Define an IFC language ▫Minimal calculus, only IFC features Combine target and IFC language ▫Allow target language to call into IFC, and vice-versa Careful definition of the IFC language allows the overall system to provide isolation, regardless of what the target language does

IFC language Tag tasks with security labels ▫Labels form a lattice, and determine how data can flow inside an application Example lattice ▫Two labels H (high) and L (low) ▫Flow from H to L is not allowed H L

IFC language: labels

IFC language: sandboxing Isolate an expression as a new task ▫sandbox e New task has separate state 1 e 12 sandbox e

Inter-task communication 1212

2222

What is a programming language?

Example: Mini-ECMAScript

Notation

IFC language

Embedding [Matthews and Findler, POPL’07] Extend IFC and target language syntax Re-interpret context and reduction relation

Sandboxing sandbox e does ▫Create new task for e ▫Separate state for new task ▫Schedule e according to scheduling policy

Security Guarantees

Erasure function

Termination sensitive non-interference (TSNI)

Practicality Formalism requires separate heaps An implementation might want to have one heap Naïve implementation is insecure ▫Shared references, need additional checks 12 12

Modifying the Combined Language Single heap only requires restricting transition rules ▫Intuitively appears OK ▫In general, not safe We give a class of restrictions that is safe ▫In a nutshell: restriction cannot depend on secret data

Summary So Far Clean separation of IFC and target language ▫Allows reasoning without knowledge of target ▫Implementation doesn’t need to change existing language much Example: Implementation for NodeJS ▫No changes to Javascript runtime ▫Worker threads implement tasks ▫Trusted main worker implements IFC checks

Implementation IFC for Node.js ▫No changes to Javascript runtime or Node.js ▫Worker threads implement tasks ▫Trusted main worker implements IFC checks Also in the paper: ▫Connect formalism to Haskell IFC system ▫Sketch a C implementation using our system Trusted IFC Worker Task Workers

Separation Facilitates Safe Design Clean separation of IFC and target ▫Simplifies reasoning about safe extensions Example: Exceptions ▫If target language has exceptions, they stop propagation on task boundary LIO (Haskell library for IFC), exceptions were labeled ▫Complicated design ▫One rule was wrong

Conclusions Formalism for dynamic coarse-grained IFC for many programming languages ▫Little reliance on language details Combining operational semantics of two languages as key mechanism to formalize our system ▫Allows security proofs to be once and for all

Questions?

Example: security on the web Modern web pages involve many components ▫Javascript of the website ▫Javascript of some (untrusted) library ▫Advertising code ▫Browser addons Web content can be very sensitive ▫Online banking, passwords, personal information, etc.

Current situation Code written by many different parties ▫Potentially mutually distrusting parties ▫Computing over sensitive data IFC to the rescue ▫Label sensitive data as such ▫Prevent flow of sensitive data to undesired places (like arbitrary web servers)

Concrete Example Password strength checking Website uses check_strength(pw) from a (not fully trusted) library ▫The library could send the password to bad.com With IFC, we can precisely decide what the library can do with the password

Why isn’t everyone using IFC? We are interested in a dynamic IFC system A key challenge is performance ▫Tracking information at a fine-grained level is expensive

Coarse-grained IFC The program is split into computational units (tasks) ▫All data within one task has a single label Different computational units can communicate

Advantages of coarse-grained IFC 1.Efficiency ▫Checks only at isolation boundaries 2.Minimal changes to language ▫If added to a language retroactively 3.Reuse existing programs 4.Simple ▫to understand and reason about

Goals Formally define a core calculus for a coarse- grained dynamic IFC system Combine IFC language with any programming language Prove security guarantees of IFC (known as non-interference)

Approach Overview Given a target language (any programming language) Define an IFC language ▫Minimal calculus, only IFC features Combine target and IFC language ▫Allow target language to call into IFC, and vice-versa Careful definition of the IFC language allows the overall system to provide isolation, regardless of what the target language does

IFC language Tag data with security labels ▫Labels form a lattice, and determine how data can flow inside an application Example lattice ▫Two labels H (high) and L (low) ▫Flow from H to L is not allowed H L

IFC language: labels

IFC language: sandboxing Isolate an expression as a new task ▫sandbox e 1 e 12 sandbox e

Inter-task communication 1212

2222

What is a programming language?

Example: Mini-ECMAScript

Notation

IFC language

Embedding [Matthews and Findler, POPL’07] Extend IFC and target language syntax Re-interpret context and reduction relation

Sandboxing sandbox e does ▫Create new task for e ▫Schedule e according to scheduling policy

Security Guarantees

Erasure function

Termination sensitive non-interference (TSNI)

Real world examples Is this actually practical? One challenge are external effects ▫File system, internet connection, etc. Possible solutions ▫Make external effects inaccessible ▫Internalize them into the IFC language  Labeled file system

COWL [OSDI’14] Implementation of coarse-grained dynamic IFC system for Javascript Websites have access to XHR constructor ▫XHR requests need to be modeled at the IFC language level COWL chooses origins ( example.com ) as labels

Password strength checker in COWL Even if check_strength(pw) is completely untrusted, it cannot send the password to bad.com Execute check_strength in a sandboxed task

Conclusions Coarse-grained IFC is great ▫Allows for language-independent IFC system ▫Efficient, yet flexible Combining operational semantics of two languages as key mechanism to formalize our system

Questions?

Basic rules

Inter-task communication Sending places message on global queue Receiving either receives the message, or drops it (based on label)

Embedding Extend IFC and target language syntax Re-interpret context and reduction relation

Sandboxing sandbox e does ▫Create new task for e ▫Schedule e according to scheduling policy

Remaining rules

Scheduling policies Concurrent, round robin Sequential

Why IFC? Solves many existing security problems ▫Example web client side  Combination of scripts on a site  Not full isolation, want flexibility (password strength checker)  Browser addons ▫Other plugin systems

Intro Define IFC Motivation why IFC is useful Motivation why coarse-grained IFC is cool Others have already done IFC! ▫Not generally for any language ▫Not coarse-grained dynamicly

Motivation Given a piece of code (e.g. a library), under what conditions is it correct to invoke it? ▫What are the conditions on a, fromIndex, etc? void sort(int[] a, int fromIndex, int toIndex);

Backwards analysis Sequential composition ▫push_back (s1;s2) fg = push_back s1 (push_back s2 fg) Assignment ▫push_back (e1=e2) fg = remove anything from fg that might get invalidated by the assignment but keep everything that matches e1 exactly, and replace it with e2

Example Assignment // FG: 3 == c a[j] = 3; // FG: a[i] < b || a[j] == c