• No results found

End-to-end Protection of Web Services. Tracking. Hao Chen and Benjamin Davis UC Davis. Web services are highly attractive targets

N/A
N/A
Protected

Academic year: 2021

Share "End-to-end Protection of Web Services. Tracking. Hao Chen and Benjamin Davis UC Davis. Web services are highly attractive targets"

Copied!
35
0
0

Loading.... (view fulltext now)

Full text

(1)

of Web Services

with Information Flow

with Information Flow

Tracking

H

Ch

d B j

i D i

Hao Chen and Benjamin Davis

UC Davis

MURI Final Review Briefing

June 13, 2012

Helix MURI Project -- http://helix.cs.virginia.edu

Web services are highly attractive targets

Over 60% of attacks target Web applications

O e 60% o attac s ta get eb app cat o s

Over 80% of vulnerabilities found are in Web

(2)

<h1>Latest Comment</h1>

<p>

{User Content} 3 3

</p>

<h1>Latest Comment</h1>

<p>

This is <b>great!</b>

(3)

<h1>Latest Comment</h1>

<p>

<script>

steal(document.cookie);

</script>

5 5

</script>

</p>

Application ? ? ? ? ?

(4)

Information Flow Tracking System Application   Input !! 7 7   Information Flow Tracking System Application  

(5)

Information Flow Tracking System Application   !! 9 9  !!  Information Flow Tracking System Application   !!  !!  Output !!

(6)

Information Flow Tracking System Application   !!

X

11 11  !!  !! Output

X

Language-based “taint mode”

Perl

Ruby

Adding support to language structures

Java [Chin, Wagner 09]

PHP [Venema]

(7)

Information Flow Tracking System Web Application Input Database Interface Database 13 13 Output Information Flow Tracking System Web Application Input Database Interface Database   !! Output  

(8)

Information Flow Tracking System Web Application Input Database Interface Database   15 15 Output  !!  Information Flow Tracking System Input Database Interface Database   !!

(9)

Information Flow Tracking System Web Application Input Database Interface Database   !! 17 17 Output   Information Flow Tracking System Web Application Input Database Interface Database   ? Output  

(10)

Information Flow Tracking System Web Application Input Database Interface Database   ? 19 19 Output   Information Flow Tracking System Input Database Interface Database   ?

(11)

What if you have multiple applications?

How to treat data from the database?

o to t eat data o t e database

All tainted -> false positives

All untainted -> false negatives

Require manual annotation?

Application-specific decisions?

21

21

Taint tracking through the entire system

[Asbestos, 05]

[HiStar, 06]

Implemented in

Hardware

OS

VMM/emulator

(12)

Web Application Input Database Interface Database !! 23 23 Output Input Database Interface Database

(13)

Web Application Input Database Interface Database !! 25 25 Output Web Application Input Database Interface Database Output

(14)

Low level/fine granularity

Hardware mechanism [Suh, Lee, Devadas 04]

Minos [Crandall, Chong, 04]

Lacks high-level database semantics

Aggregate functions

Comparisons, SELECT DISTINCT

27

27

End-to-end taint tracking

Across Web applications and databases

Leverage existing single-application

information flow tracking engines

Compatible with existing Web services

(15)

DB Interface W b A li i Database Engine SQL 29 29 Web Application DBT i DB Interface W b A li i Database Engine SQL DBTaint Web Application

(16)

Store taint data in database composite types

Tuple of form: (<value>, <taint_value>)

Store/retrieve taint values via SQL

No additional mechanisms needed in the database

No change to underlying database data structures

Id Status (19 0) (‘ l d’ 1) Id Status 19 ‘ l d’ 31 31 (19, 0) (‘closed’, 1) (27, 0) (‘open’, 1) (32, 0) (‘pending, 1) 19 ‘closed’ 27 ‘open’ 32 ‘pending’

Before DBTaint With DBTaint

Create functions that operate on composite

types

yp

Comparison operators (=, !=, <, …)

Arithmetic operations (+, -, …)

Text operations (upper, lower, …)

Aggregate functions (MAX, MIN, SUM, …)

(17)

Arithmetic operations

(4 0) + (5 1) (9 ?)

(4, 0) + (5, 1) = (9, ?)

33 33 

Arithmetic operations

(4 0) + (5 1) (9 ?)

(4, 0) + (5, 1) = (9, ?)

untainted tainted

(18)

Arithmetic operations

(4 0) + (5 1) (9 1)

(4, 0) + (5, 1) = (9, 1)

untainted tainted tainted

35

35

MAX

{(2 0) (3 1) (5 0)} = (5 ?)

{(2, 0), (3, 1), (5, 0)} = (5, ?)

(19)

MAX

{(2 0) (3 1) (5 0)} = (5 ?)

{(2, 0), (3, 1), (5, 0)} = (5, ?)

untainted tainted untainted

37

37

Untainted: trusted source

Web application defaults

Values generated entirely by the Web application

Tainted: from untrusted source, or unknown

User input

Explicit information flow

b

d l

l f

Database returns untainted value only if

(20)

MAX

{(2 0) (3 1) (5 0)} = (5 ?)

{(2, 0), (3, 1), (5, 0)} = (5, ?)

untainted tainted untainted

39

39

MAX

{(2 0) (3 1) (5 0)} = (5 0)

{(2, 0), (3, 1), (5, 0)} = (5, 0)

(21)

Equality

(3 0)

?

(3 1)

(3, 0) = (3, 1)

untainted tainted

?

41 41 

Equality

3

3

3 == 3

(22)

Equality

(3 0)

(3 1)

(3, 0) == (3, 1)

untainted tainted

43

Adopt notion of backwards-compatibility

[Chin, Wagner 09]

43 

MAX

{(5 1) (5 0)} (5 ?)

{(5, 1), (5, 0)} = (5, ?)

untainted tainted

(23)

MAX

{5 5} 5

{5, 5} = 5

45 45 

MAX

{5 5} 5

{5, 5} = 5

OR

(24)

MAX

{(5 1) (5 0)} (5 ?)

{(5, 1), (5, 0)} = (5, ?)

OR

47 47 

MAX

{(5 1) (5 0)} (5 0)

{(5, 1), (5, 0)} = (5, 0)

untainted tainted untainted

(25)

DB Interface Database Table Id Status 19 ‘closed’ 27 ‘open’ 32 ‘ di ’ 49 49 WebApp 32 ‘pending’

DB Interface Database Table

x = DB.get(id=27) Id19 Status‘closed’

27 ‘open’

32 ‘ di ’

WebApp

(26)

DB Interface Database Table x = DB.get(id=27) Id19 Status‘closed’

27 ‘open’ 32 ‘ di ’ 51 51 WebApp 32 ‘pending’

DB Interface Database Table

(27)

DB Interface Database Table x = “open” Id Status 19 ‘closed’ 27 ‘open’ 32 ‘ di ’ 53 53 WebApp 32 ‘pending’ DBTaint

DB Interface Database Table

Id Status (19, 0) (‘closed’, 1) (27, 0) (‘open’, 1) (32 0) (‘pending 1) DBTaint WebApp (32, 0) (‘pending, 1)

(28)

DBTaint Database Table Id Status (19, 0) (‘closed’, 1) (27, 0) (‘open’, 1) (32 0) (‘pending 1) x = DB.get(id=27) DB Interface DBTaint 55 55 WebApp (32, 0) (‘pending, 1) DBTaint Database Table

Rewritten query Id Status

(19, 0) (‘closed’, 1) DB Interface

(29)

DBTaint

Database Table

Result tuples Id Status

(19, 0) (‘closed’, 1) (27, 0) (‘open’, 1) (32 0) (‘pending 1) DB Interface DBTaint 57 57 WebApp (32, 0) (‘pending, 1) DBTaint Database Table Id Status (19, 0) (‘closed’, 1) (27, 0) (‘open’, 1) (32 0) (‘pending 1) DB Interface DBTaint Collapse tuples and taint appropriatel y WebApp (32, 0) (‘pending, 1) y

(30)

DBTaint Database Table x = “open” // x is tainted Id Status (19, 0) (‘closed’, 1) (27, 0) (‘open’, 1) (32 0) (‘pending 1) DB Interface DBTaint 59 59 WebApp (32, 0) (‘pending, 1)

Account for composite types in SQL queries

Collapse and taint result tuples as needed

Co apse a d ta t esu t tup es as eeded

These changes are:

Transparent to web application

High-level, portable

(31)

Parameterized queries

Prepare:

epa e

INSERT … (id, status) VALUES (?, ?)

Execute

(27, ‘open’)

61 61 

Parameterized queries

Prepare:

epa e

INSERT … (id, status) VALUES (?, ?)

// with DBTaint:

(32)

Parameterized queries

Prepare:

epa e

INSERT … (id, status) VALUES (?, ?)

// with DBTaint:

INSERT … (id, status) VALUES (

ROW(?, ?)

,

ROW(?, ?)

)

Execute

(27 ‘

’) // 27 i

t i t d ‘

’ i t i t d

63

63

(27, ‘open’) // 27 is untainted, ‘open’ is tainted

// with DBTaint:

(27,

0

, ‘open’,

1

)

Prepare phase:

Queries are passed with placeholders for data

Execute phase:

Data values are passed separately, independently

Taint tracking engine requirement:

(33)

Leverage existing single-application

information flow tracking systems

g y

No changes to Web application

DBTaint 65 65 DB Interface Web Application Single-application information flow 

Languages

Perl

Java

Database Interfaces

Perl DataBase Interface (DBI)

Java Database Connectivity (JDBC)

D t b

Database

(34)

RT: Request Tracker (ticket tracking system)

60,000+ lines of Perl

Perl DBI (DataBase Interface) API

Perl taint mode

JForum (discussion board system)

30,000+ lines of Java

Java Database Connectivity (JDBC) API

Character-level taint engine [Chin Wagner ’09]

67

Character level taint engine [Chin, Wagner 09]

67

requests/second

RT

(35)

Cross-application information flow tracking

Persistent taint tracking

e s ste t ta t t ac

g

Multiple Web applications, multiple Databases

69

69

End-to-end information flow through Web

services

Compatible with existing Web services

Requires no changes to Web applications

Taint propagation through database

References

Related documents

Siberian thermal high → forms in the winter over eastern Russia, can become rather strong (Responsible for the dry Monsoon Season from December - February in India/SW

In document “the Strategy of development tourism in the Republic of Serbia - Second Phase Report, Competitiveness Plan” (p. 94), it is anticipated that rural tourism in 2015 will

Making a claim against your employer for loss of hearing is a complex issue therefore this Claim Assessment form requires as much detail as you can provide to ensure that a

The analysis of variance revealed that the effect of the combined application of urea (inorganic N fertilizer) and cow manure as inorganic N equivalence was

gliricidia, trichantera, indi- gofera, calliandra, papaya leaves, cassava leaves, leucaena, rapeseed meal, corn gluten feed, soybean meal, copra meal, palm kernel meal, fish and

(19) reported dif- ferent features of angiogenesis between ovarian and breast car- cinoma and found that angiogenesis in ovarian carcinoma was lower than in breast carcinoma

As the group target’s motion shows a clear orientation in many occasions, a ran- dom matrix approach is derived based on Bayesian theory for maneuvering target tracking, which does

We present three algorithms; the first algorithm Iterative is efficient in reconstructing the main diago- nals in case the nodes corresponding to the hidden M are such, that they