static verification for web scripting languages

166
Static Verification for Web Scripting Languages Ravi Chugh

Upload: thor-bradshaw

Post on 01-Jan-2016

53 views

Category:

Documents


2 download

DESCRIPTION

Static Verification for Web Scripting Languages. Ravi Chugh. Web Platform. Web Platform. Untrusted Code. Scripting Languages. My Goal: Rigorous Foundations. Web Platform. Untrusted Code. Static Types and Logic!. Scripting Languages. 1995. Web Page = Static HTML Web Page + Links - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Static Verification for Web Scripting Languages

Static Verification forWeb Scripting

Languages

Ravi Chugh

Page 2: Static Verification for Web Scripting Languages

2

Web Platform

Page 3: Static Verification for Web Scripting Languages

3

Web Platform

ScriptingLanguages

Untrusted

Code

Page 4: Static Verification for Web Scripting Languages

4

Web Platform

My Goal: Rigorous FoundationsStatic Types and Logic!

Untrusted

Code

ScriptingLanguages

Page 5: Static Verification for Web Scripting Languages

5

1995

<html>

</html>

Username

Login

Password

Web Page = Static HTMLWeb Page + LinksWeb Page + Client-Side Code

<script type=“javascript”>

loginButton.onclick = function () {

if (passwordBox.value == “”) {

alert(“Enter password!”);

} else {

...

} }

</script>

Page 6: Static Verification for Web Scripting Languages

6

1995

… an easy-to-use “scripting language”as a companion to Java

No Static Types

“Dynamic” Features Make itEasy to Experiment…

Brendan Eich,JavaScript creator

Page 7: Static Verification for Web Scripting Languages

2013

Page 8: Static Verification for Web Scripting Languages

2013Asked whether Gmail would ever open up an API for developers to code add-ons and plug-ins with more official support and stability, Kowitz suggested it was unlikely. Gmail is based on “hundreds of thousands” of lines of JavaScript, Kowitz said, and it's a code base that “changes so quickly.” That said, Jackson said the Gmail team "loves" to see third-party functionality being developed, and the team tries to make developers aware of changes they know will affect those products. Article on LifeHacker

Page 9: Static Verification for Web Scripting Languages

2013Asked whether Gmail would ever open up an API for developers to code add-ons and plug-ins with more official support and stability, Kowitz suggested it was unlikely. Gmail is based on “hundreds of thousands” of lines of JavaScript, Kowitz said, and it's a code base that “changes so quickly.” That said, Jackson said the Gmail team "loves" to see third-party functionality being developed, and the team tries to make developers aware of changes they know will affect those products. Article on LifeHacker

“Scripting”?!?

Page 10: Static Verification for Web Scripting Languages

10

http://stackoverflow.com/tags02-03-13

Count Tag411,345 C#361,080 Java337,896 PHP321,757 JavaScript175,765 C++160,768 Python

83,486 C64,345 Ruby

9,827 Haskell1,347 OCaml

JavaScript isEverywhere

2013

Page 11: Static Verification for Web Scripting Languages

11

http://stackoverflow.com/tags02-03-13

Count Tag411,345 C#361,080 Java337,896 PHP321,757 JavaScript175,765 C++160,768 Python

83,486 C64,345 Ruby

9,827 Haskell1,347 OCaml

Popular Server-Side Scripting Languages

2013

JavaScript isEverywhere

Page 12: Static Verification for Web Scripting Languages

12

News

ShoppingBanking 2013

JavaScript isEverywhere

Page 13: Static Verification for Web Scripting Languages

13

News

ShoppingBanking

Third-Party Ads

2013

JavaScript isEverywhere

Page 14: Static Verification for Web Scripting Languages

14

News

ShoppingBanking

Third-Party Ads

Third-Party Apps

2013

JavaScript isEverywhere

Page 15: Static Verification for Web Scripting Languages

15

2013

JavaScript isEverywhere

Third-Party

Page 16: Static Verification for Web Scripting Languages

16

No longerjust “scripting”

2013

… an easy-to-use “scripting language”as a companion to Java

Page 17: Static Verification for Web Scripting Languages

17

JavaScript ismuch harder than Java

2013

… an easy-to-use “scripting language”as a companion to Java

No longerjust “scripting”

Page 18: Static Verification for Web Scripting Languages

18

… New Yorker article, “The Itch,” …

Page 19: Static Verification for Web Scripting Languages

19

Page 20: Static Verification for Web Scripting Languages

20

PRINT

Page 21: Static Verification for Web Scripting Languages

“?printable=true”

21

“I want every article in print

mode”

Page 22: Static Verification for Web Scripting Languages

Browser Extensions

Third-Party DevelopersCustomize

Browser

22

Page 23: Static Verification for Web Scripting Languages

Browser Extensions

PRINTNEW YORKER

23

Page 24: Static Verification for Web Scripting Languages

Browser Extensions

for (var elt in doc.getEltsByTagName(“a”)) {

var url = elt.getAttr(“href”);

if (url.match(/^newyorker.com/)) {

elt.setAttr(“href”, url + “?printable=true”);

} }

24

Page 25: Static Verification for Web Scripting Languages

Browser Extensions

PRINTNEW YORKER

Document (DOM)

host-site.com

25

?printable=true

newyorker.com

Page 26: Static Verification for Web Scripting Languages

Browser Extensions

PRINTNEW YORKER

Document (DOM)

host-site.com

26

?printable=true

newyorker.comevil.com EVIL

PasswordsBank Accts

History

Network Manager

OtherSensitive

APIs

JavaScriptEngine

BUGGY

Page 27: Static Verification for Web Scripting Languages

27

Dynamic Checking…Expensive

Misses AttacksCan Blame Wrong Party

Goal: Static Verification

Enforcing JavaScript Security?

Page 28: Static Verification for Web Scripting Languages

28

My Dissertation

Static Types for JavaScriptfor Dynamic Languages

1. Reliability / Security2. Development Tools3. Performance

Page 29: Static Verification for Web Scripting Languages

29

My Dissertation

Static Types for JavaScriptfor Dynamic Languages

Working with JavaScriptCan Have Long-Term Impact

Many Challenges of Web are Independent of Language

New Techniques Apply to Traditional Languages

Page 30: Static Verification for Web Scripting Languages

30

Static Types for JavaScriptDescribe sets of run-time values

“integers”

“booleans”

“objects with foo field”

“non-nullpointers”

“urls that are safe to visit”

Page 31: Static Verification for Web Scripting Languages

31

Static Types for JavaScriptPrevent classes of run-time errors

“integers”

“booleans”

“objects with foo field”

“non-nullpointers”

“urls that are safe to visit”

“multiplyint and bool” “foo field

not found”“foo fieldnot found”

“null pointer exception”

“null pointer exception”

“navigating to evil.com”“redirect to evil.com”

Page 32: Static Verification for Web Scripting Languages

32

f(x)

“expected args”“actual args”

Type1 Type2

“function call produces no error”✓

Page 33: Static Verification for Web Scripting Languages

33

f(x)

“expected args”“actual args”

Type1 Type2

“function call may produce error”✗

Page 34: Static Verification for Web Scripting Languages

34

Type1 Type2{x|p }

{x|q }

{x|p }

{x|q }

Types + LogicRefinement Types

“expected args”“actual args”

Page 35: Static Verification for Web Scripting Languages

35

Types

Refinement Types

Nested Refinements [POPL ’12]Key to Encode Dynamic Features

Logic

{x|p } f :: {y|q }

Page 36: Static Verification for Web Scripting Languages

Expressiveness

Usability

Types

VerificationHoare Logics

Model CheckingAbstract Interpretation

Theorem Proving…

+ Logic Dependent JavaScript (DJS)[POPL ’12, OOPSLA ’12]

Page 37: Static Verification for Web Scripting Languages

Why is JavaScript Important?Why is JavaScript Hard?

Static Types via LogicSecurity via Logic

Looking Ahead

37

OutlineWhy JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Page 38: Static Verification for Web Scripting Languages

Why is JavaScript Important?

Why is JavaScript Hard?Static Types via Logic

Security via LogicLooking Ahead

38

OutlineWhy JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Page 39: Static Verification for Web Scripting Languages

Why is JavaScript Hard?

39

OutlineWhy JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Lightweight ReflectionDictionary ObjectsAdditional Challenges

Page 40: Static Verification for Web Scripting Languages

40

function negate(x) {

if (typeof x == “number”) {

}

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

xQ: What is my “type”?

Page 41: Static Verification for Web Scripting Languages

41

All JavaScript Values

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

{x|tag(x) = “number” }

{x|tag(x) = “boolean” }

true false

{x|tag(x) = “object” }

{ } { “f”:17 }

{ “f”:42, “g”:true }...

Q: What is my “type”? x17 42

3.14-1

...

Page 42: Static Verification for Web Scripting Languages

42

function negate(x) {

if (typeof x == “number”) {

}

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

xQ: What is my “type”?A: Described by “tag”

Page 43: Static Verification for Web Scripting Languages

43

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

function negate(x) {

if (typeof x == “number”) {

return 0 - x;

} else {

return !x;

}

}

“expected args”

values with tag“number” OR “boolean”

Page 44: Static Verification for Web Scripting Languages

Why is JavaScript Hard?

44

OutlineWhy JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Lightweight Reflection

Dictionary ObjectsAdditional Challenges

Page 45: Static Verification for Web Scripting Languages

45

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

obj.f means obj[“f”]

a.k.a.“maps”“hash tables”“associative arrays”

Objects are “Dictionaries”that mapstring keysto values

Page 46: Static Verification for Web Scripting Languages

46

methodto invoke

methodtable

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

function dispatch(table, op, i, j) { }

Page 47: Static Verification for Web Scripting Languages

47

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

var integerOps = { “+” : function (n, m) { … } , “-” : function (n, m) { … } };

function dispatch(table, op, i, j) { var fn = table[op]; return fn(i, j); }

dispatch (integerOps, “*”, 17, 42);

“foo fieldnot found”“*” key

not found

Page 48: Static Verification for Web Scripting Languages

48

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

function dispatch(table, op, i, j) { var fn = table[op]; return fn(i, j); }

“expected args”

table object with an op key that stores a function on numbers

Dependencybetween types

of arguments

Page 49: Static Verification for Web Scripting Languages

Why is JavaScript Hard?

49

OutlineWhy JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Lightweight ReflectionDictionary ObjectsAdditional Challenges

Page 50: Static Verification for Web Scripting Languages

Why is JavaScript Hard?

50

OutlineWhy JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Lightweight ReflectionDictionary Objects Extensible ObjectsPrototype InheritanceArray Semantics

Page 51: Static Verification for Web Scripting Languages

Unsupported in Prior Work

Why is JavaScript Hard?

51

OutlineWhy JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Lightweight ReflectionDictionary Objects Extensible ObjectsPrototype InheritanceArray Semantics

Page 52: Static Verification for Web Scripting Languages

Why is JavaScript Important?Why is JavaScript Hard?

Static Types via LogicSecurity via Logic

Looking Ahead

52

OutlineWhy JavaScript? Types via Logic Security via Logic Looking AheadChallengesChallenges Types via Logic

Page 53: Static Verification for Web Scripting Languages

53

All JavaScript Values{x|tag(x) = “number” }

true false

{ } { “f”:17 }

{ “f”:42, “g”:true }...

17 42

3.14-1

...

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

Page 54: Static Verification for Web Scripting Languages

54

All JavaScript Values{x|tag(x) = “number” }

17 42

3.14-1

...

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

{x|tag(x) = “boolean” }

{x|tag(x) = “object” }

true false

{ } { “f”:17 }

{ “f”:42, “g”:true }...

Page 55: Static Verification for Web Scripting Languages

55

All JavaScript Values

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

{ } { “f”:17 }

{ “f”:42, “g”:true }...{x|x = true }

true false

{x|integer(x) }

{x|x > 0 }

17 42

3.14-1

...

Page 56: Static Verification for Web Scripting Languages

56

All JavaScript Values

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

“set of values x s.t. formula p is true”

{x|p }Refinement Types

Page 57: Static Verification for Web Scripting Languages

57

f(x)

“expected args”“actual args”

Type1 Type2

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

Page 58: Static Verification for Web Scripting Languages

58

f(x)

“expected args”“actual args”

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

{x|p }

{x|q }

{x|p }

{x|q }

Page 59: Static Verification for Web Scripting Languages

59

is Subtyping is Set Inclusion is Implication

Type1 Type2

Why JavaScript? Security via Logic Looking AheadChallenges Types via Logic

{x|p }

{x|q }

{x|p }

{x|q }

Page 60: Static Verification for Web Scripting Languages

Static Types via Logic

60

OutlineWhy JavaScript? Security via Logic Looking AheadChallenges Types via Logic

Lightweight ReflectionDictionary ObjectsKey Technical InnovationsEvaluation

Page 61: Static Verification for Web Scripting Languages

61

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

function negate(x) {

if (typeof x == “number”) {

return 0 - x;

} else {

return !x;

} }

Type Annotation in Comments

//: negate :: (x:NumOrBool) NumOrBool

{v|tag(v) = “number” ∨ tag(v) = “boolean” }

NumOrBool

Syntactic Sugarfor Common Types

Page 62: Static Verification for Web Scripting Languages

62

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

function negate(x) {

if (typeof x == “number”) {

return 0 - x;

} else {

return !x;

} }

//: negate :: (x:NumOrBool) NumOrBool

{x|tag(x) = “number” }

“expected args”

{x|tag(x) = “number” }

{x|tag(x) = “number” }

{x|tag(x) = “number” }✓

Page 63: Static Verification for Web Scripting Languages

63

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

function negate(x) {

if (typeof x == “number”) {

return 0 - x;

} else {

return !x;

} }

//: negate :: (x:NumOrBool) NumOrBool

“expected args”

{x|tag(x) = “boolean” }

✓{x|not(tag(x) = “number”)

{x| ∧ (tag(x) = “number” ∨

{x| tag(x) = “boolean”) }

Page 64: Static Verification for Web Scripting Languages

64

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

function negate(x) {

if (typeof x == “number”) {

return 0 - x;

} else {

return !x;

} }

//: negate :: (x:NumOrBool) NumOrBool

Logic EnablesPath-SensitiveReasoning on

Branches

Page 65: Static Verification for Web Scripting Languages

65

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

function negate(x) {

if (typeof x == “number”) {

return 0 - x;

} else {

return !x;

} }

Logic Enables Types to Depend on Values

//: negate :: (x:NumOrBool) { y|tag(y) = tag(x) }

Page 66: Static Verification for Web Scripting Languages

Static Types via Logic

66

OutlineWhy JavaScript? Security via Logic Looking AheadChallenges

Lightweight ReflectionDictionary ObjectsKey Technical InnovationsEvaluation

Types via Logic

Page 67: Static Verification for Web Scripting Languages

67

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

All JavaScript Values

{x|tag(x) = “object” }

...

{ }

{ “f”:true }

{ “f”:17 }

{ “f”:42, “g”:null }

Page 68: Static Verification for Web Scripting Languages

68

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

All JavaScript Values

{x|tag(x) = “object” has(x,“f”) }

...

{ }

{ “f”:true }

{ “f”:17 }

{ “f”:42, “g”:null }

Page 69: Static Verification for Web Scripting Languages

69

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

All JavaScript Values

{x|tag(x) = “object” {x|has(x,“f”) {x|tag(sel(x,“f”)) = “number” }

...

{ }

{ “f”:true }

{ “f”:17 }

{ “f”:42, “g”:null }

Page 70: Static Verification for Web Scripting Languages

70

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

All JavaScript Values

{x|sel(x,“f”) = true {x|dom(x) = {“f”} }

...

{ }

{ “f”:true }

{ “f”:17 }

{ “f”:42, “g”:null }

Page 71: Static Verification for Web Scripting Languages

71

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

//: dispatch ::

//: ({ table | tag(table) = “object” },

//: { op | tag(op) = “string”

//: { op | ∧ has(table,op)

//: { op | ∧ sel(table,op) :: (Num,Num) Num },

//: { i | tag(i) = “number” },

//: { j | tag(j) = “number” })

//: Num

function dispatch(table, op, i, j) { var fn = table[op]; return fn(i, j); }

Page 72: Static Verification for Web Scripting Languages

72

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

//: dispatch ::

//: (table : { sel(table,op) :: (Num,Num) Num },

//: op : Str,

//: i : Num,

//: j : Num)

//:

//:

//: Num

function dispatch(table, op, i, j) { var fn = table[op]; return fn(i, j); }

Page 73: Static Verification for Web Scripting Languages

73

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

var integerOps = { “+” : …, “-” : … };

dispatch (integerOps, “*”, 17, 42);

{op|op = “*” }

“actual args”{op|has(integerOps,op) }

Type Checking Prevents Run-Time Error

{op|op = “*” }

{op|has(integerOps,op) }✗

Page 74: Static Verification for Web Scripting Languages

Static Types via Logic

74

OutlineWhy JavaScript? Security via Logic Looking AheadChallenges

Lightweight ReflectionDictionary ObjectsKey Technical InnovationsEvaluation

Types via Logic

Page 75: Static Verification for Web Scripting Languages

75

PriorRefinement

Types

✓✗

lightweight reflection

dictionary objects

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

extensible objects

prototype inheritance

array semantics

✗✗✗

Dependent JavaScript

(DJS)[POPL ’12, OOPSLA ’12]

✓✓✓✓✓

Page 76: Static Verification for Web Scripting Languages

Key Challenge:Function Subtyping

as Logical Implication76

PriorRefinement

Types

✗dictionary objects

Dependent JavaScript

(DJS)[POPL ’12, OOPSLA ’12]

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Page 77: Static Verification for Web Scripting Languages

77

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

42 + negate (17)

{f|f :: }(x:Num) Num “expected function”

{f|f :: } (x:NumOrBool) { y|tag(y) = tag(x) }

Page 78: Static Verification for Web Scripting Languages

{f|f :: }

78

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

(x:NumOrBool) { y|tag(y) = tag(x) }

{f|f :: }(x:Num) Num

How to Prove

?How to Encode Type System Inside Logic?

Prior Refinement SystemsDisallow Function Types Inside Logic!

Page 79: Static Verification for Web Scripting Languages

79

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

T ::= {x|p }

| T1 T2

Types Refinement Logic

Satisfiability Modulo Theories (SMT)

SAT + Decidable Theories

p q✓✗

SMT Solver(e.g. Z3)

[Prior State-of-the-Art]

Page 80: Static Verification for Web Scripting Languages

80

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

T ::= {x|p }

| T1 T2

p ::= p ∧ q | p ∨ q | p

| x = y | x > y | …

| tag(x) = “number” | …

| sel(x,k) = 17 | …

Types Refinement Logic

• Boolean Connectives• Equality• Linear Arithmetic• Uninterpreted Functions• McCarthy Arrays

Page 81: Static Verification for Web Scripting Languages

81

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

T ::= {x|p }

| T1 T2

p ::= p ∧ q | p ∨ q | p

| x = y | x > y | …

| tag(x) = “number” | …

| sel(x,k) = 17 | …

Types Refinement Logic

{v|tag(v) = “number” ∨ tag(v) = “boolean” }NumOrBool

Enables Union Types and Lightweight Reflection

Page 82: Static Verification for Web Scripting Languages

82

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

T ::= {x|p }

| T1 T2

p ::= p ∧ q | p ∨ q | p

| x = y | x > y | …

| tag(x) = “number” | …

| sel(x,k) = 17 | …

Types Refinement Logic

Enables Dictionary Types with Dynamic Keys …{d|tag(sel(d,k)) = “boolean” ∧

{d|tag(sel(d,“f”)) = “function” ∧

{d|sel(d,“f”) ??? }

But DisallowsFunctions inDictionaries!

Page 83: Static Verification for Web Scripting Languages

83

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

p ::= p ∧ q | p ∨ q | p

| x = y | x > y | …

| tag(x) = “number” | …

| sel(x,k) = 17 | …

| sel(x,k) :: T1 T2 | …

Types Refinement Logic

Goal: Refer to Type System Inside LogicGoal: Without Giving up Decidability

T ::= {x|p }

| T1 T2

Solution: Nested Refinements!

Page 84: Static Verification for Web Scripting Languages

84

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

T ::= {x|p } p ::= p ∧ q | p ∨ q | p

| x = y | x > y | …

| tag(x) = “number” | …

| sel(x,k) = 17 | …

| sel(x,k) :: T1 T2 | …

Nested Refinements [POPL ’12]1. Decidable Encoding2. Precise Subtyping3. Type Soundness Proof

Types Refinement Logic

Page 85: Static Verification for Web Scripting Languages

85

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

{f|f :: } (x:NumOrBool) { y|tag(y) = tag(x) }

{f|f :: }(x:Num) Num

Decidable Encoding

Uninterpreted Predicate in Logic

Distinct UninterpretedConstants in Logic…

Page 86: Static Verification for Web Scripting Languages

{f|f :: }

86

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

(x:NumOrBool) { y|tag(y) = tag(x) }

{f|f :: }(x:Num) Num

Decidable Encoding

Uninterpreted Predicate in Logic

w/ Types Nested Inside

Distinct UninterpretedConstants in Logic…

Page 87: Static Verification for Web Scripting Languages

87

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Decidable Encoding

{f|f :: } (x:NumOrBool) { y|tag(y) = tag(x) }

{f|f :: }(x:Num) Num

✗SMTSolver

Trivially Decidable, but Imprecise

Page 88: Static Verification for Web Scripting Languages

88

p f :: (x:S1) S2

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

{f|f :: }(x:T1) T2

{f|p }

Precise Subtyping

Step 1:

Step 2:

Find such that(x:S1) S2

SMTSolver✓

T1 S1 ✓✓S2 T2x:T1

Compare and(x:S1) S2 (x:T1) T2

“contra-variance”

“co-variance”

Page 89: Static Verification for Web Scripting Languages

89

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

{f|f :: }(x:Num) Num{f|f = negate }

Precise Subtyping

Step 1:

Step 2:

f = negate

f :: (x:NumOrBool) { y|tag(y) = tag(x) }SMTSolver✓

Page 90: Static Verification for Web Scripting Languages

90

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

{f|f :: }(x:Num) Num{f|f = negate }

Precise Subtyping

Step 1:

Step 2:

f = negate

f :: (x:NumOrBool) { y|tag(y) = tag(x) }

Num

NumOrBool ✓✓{y|tag(y) = tag(x) } Nu

mx:Num

✓SMT

Solver✓

Page 91: Static Verification for Web Scripting Languages

91

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Precise Subtyping

Step 1:

Step 2:

Decidable Reasoningvia SMT

Precise Function Subtypingvia Syntactic Techniques

+

{f|f :: }{f|f = negate } ✓(x:Num) Num

Page 92: Static Verification for Web Scripting Languages

92

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Type Soundness Proof

Logic 0

Conventional ProofsRequire Logic to be an Oracle …

… but Nesting Introduces CircularityThat Prevents Typical Inductive Proofs

Type System 0

Page 93: Static Verification for Web Scripting Languages

93

Type System ∞

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Type Soundness Proof

Logic 0

Logic 1

Logic 2

Type System 1

Type System 2

Type System 0

… …

Proof Technique:Stratify into Infinite Hierarchy

Page 94: Static Verification for Web Scripting Languages

94

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

T ::= {x|p } p ::= p ∧ q | p ∨ q | p

| x = y | x > y | …

| tag(x) = “number” | …

| sel(x,k) = 17 | …

| sel(x,k) :: T1 T2 | …

Nested Refinements [POPL ’12]

Types Refinement Logic

Key to Encode Dictionary Objects(Even in Statically Typed Languages!)

Page 95: Static Verification for Web Scripting Languages

95

lightweight reflection

dictionary objects

extensible objects

prototype inheritance

array semantics

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Dependent JavaScript

(DJS)[POPL ’12, OOPSLA ’12]

✓✓✓✓✓

PriorRefinement

Types

✓✗✗✗✗

Page 96: Static Verification for Web Scripting Languages

JavaScript

JavaScript, Python, Ruby

96

lightweight reflection

dictionary objects

extensible objects

prototype inheritance

array semantics

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Dependent JavaScript

(DJS)[POPL ’12, OOPSLA ’12]

✓✓✓✓✓

Page 97: Static Verification for Web Scripting Languages

Static Types via Logic

97

OutlineWhy JavaScript? Security via Logic Looking AheadChallenges

Lightweight ReflectionDictionary ObjectsKey Technical InnovationsEvaluation

Types via Logic

Page 98: Static Verification for Web Scripting Languages

98

306a

408(+33%)

LOCbefore/after

13 Excerpts from: JavaScript, Good Parts SunSpider Benchmark Suite Google Closure Library

Benchmarks

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Chosen to Stretch the Limits of DJS

Page 99: Static Verification for Web Scripting Languages

99

306a

408(+33%)

LOCbefore/after

13 Excerpts from: JavaScript, Good Parts SunSpider Benchmark Suite Google Closure Library

Benchmarks

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

9 Browser Extensions from: [Guha et al. Oakland ’11]

321a

383(+19%)

1,003a

1,027(+2%)

2 Examples from: Google Gadgets

1,630

1,818(+12%)

TOTALS

Page 100: Static Verification for Web Scripting Languages

100

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

1,630

1,818(+12%)

TOTALS

Already Improved by SimpleType Inference and Syntactic Sugar

Plenty of Room for Improvement• Iterative Predicate Abstraction• Bootstrap from Run-Time Traces [STOP ’11]

1,818(+12%)

Page 101: Static Verification for Web Scripting Languages

101

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

1,630

1,818(+12%)

TOTALS

Already Improved using SimpleType Inference and Syntactic Sugar

Plenty of Room for Improvement• Apply State-of-the-Art Techniques• Bootstrap from Run-Time Traces [STOP ’11]

1,630

Will Enable Larger Examples

Page 102: Static Verification for Web Scripting Languages

102

LOCbefore/after

13 Excerpts from: JavaScript, Good Parts SunSpider Benchmark Suite Google Closure Library

306a

408(+33%)

Benchmarks

9 Browser Extensions from: [Guha et al. Oakland ’11]

321a

383(+19%)

2 Examples from: Google Gadgets

1,003a

1,027(+2%)

1,630

1,818(+12%)

10 sec

Running Time

3 sec

19 sec

32 sec

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

TOTALS

Page 103: Static Verification for Web Scripting Languages

103

1,818(+12%)

32 sec

Why JavaScript? Types via Logic Security via Logic Looking AheadChallenges

Already Improved by SimpleOptimizations• Avoid SMT Solver When Possible• Reduce Precision for Common Patterns

Plenty of Room for Improvement

1,630

TOTALS

32 sec

Page 104: Static Verification for Web Scripting Languages

Static Types via Logic

104

OutlineWhy JavaScript? Security via Logic Looking AheadChallenges

Lightweight ReflectionDictionary ObjectsKey Technical InnovationsEvaluation

Types via Logic

Page 105: Static Verification for Web Scripting Languages

Types via Logic

Why is JavaScript Important?Why is JavaScript Hard?

Static Types via LogicSecurity via Logic

Looking Ahead

105

OutlineWhy JavaScript? Security via Logic Looking AheadChallenges Types via Logic Security via Logic

Page 106: Static Verification for Web Scripting Languages

106

OutlineWhy JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Security via Logic Browser Extensions

Types for Fine-Grained Policies

Page 107: Static Verification for Web Scripting Languages

Browser Extensions

PRINTNEW YORKER

107

host-site.com

Document (DOM)

PasswordsBank Accts

History

Network Manager

OtherSensitive

APIs

JavaScriptEngine

BUGGY

EVIL

Page 108: Static Verification for Web Scripting Languages

108

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Policy Expressiveness

Access All Resources

Page 109: Static Verification for Web Scripting Languages

109

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Access Some Resources

cannot access DOM cannot access History

Policy Expressiveness

Page 110: Static Verification for Web Scripting Languages

110

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Policy Expressiveness

coarse-grainedand uninformative!

cannot access DOM cannot access History

Page 111: Static Verification for Web Scripting Languages

111

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Policy Expressiveness

coarse-grainedand uninformative!

similar situation forother app platforms

Page 112: Static Verification for Web Scripting Languages

112

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Policy Expressiveness

Fine-Grained PoliciesGOAL

Page 113: Static Verification for Web Scripting Languages

113

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

can write “a” elementsbut only “href” attribute

when original “href” valuestarts with “newyorker.com”and is prefix of new value

Fine-Grained PoliciesGOAL

Page 114: Static Verification for Web Scripting Languages

114

OutlineWhy JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Security via Logic Browser Extensions

Types for Fine-Grained Policies

Page 115: Static Verification for Web Scripting Languages

115

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Types for Security+ JavaScript Verification

= Fine-Grained Web Security

[ESOP ’10, Guha et al. ’11]

[POPL ’12, OOPSLA ’12]

[current]

Page 116: Static Verification for Web Scripting Languages

116

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Static Verification (DJS)

Security Expert

User

reviews only policy

reads informative policy

Developerwrites policy in logic!

Page 117: Static Verification for Web Scripting Languages

117

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Network Manager

request, …

JS Engine

eval, …

DOM

getAttr, setAttr, …

request ::

url:Str

Str

Page 118: Static Verification for Web Scripting Languages

118

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Network Manager

request, …

JS Engine

eval, …

DOM

getAttr, setAttr, …

request ::

{url:Str|WhiteListed(url)}

Str

Page 119: Static Verification for Web Scripting Languages

119

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Network Manager

request, …

JS Engine

eval, …

DOM

getAttr, setAttr, …

eval ::

s:Str

Void

Page 120: Static Verification for Web Scripting Languages

120

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Network Manager

request, …

JS Engine

eval, …

DOM

getAttr, setAttr, …

eval ::

{s:Str|not(Tainted(s))}

Void

Page 121: Static Verification for Web Scripting Languages

121

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Network Manager

request, …

JS Engine

eval, …

DOM

getAttr, setAttr, …

getAttr ::

elt:Element

attr:Str

Str

Page 122: Static Verification for Web Scripting Languages

122

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Network Manager

request, …

JS Engine

eval, …

DOM

getAttr, setAttr, …

getAttr ::

elt:Element

{attr:Str|CanRead(elt,attr)}

Str

Page 123: Static Verification for Web Scripting Languages

123

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Network Manager

request, …

JS Engine

eval, …

DOM

getAttr, setAttr, …

setAttr ::

elt:Element

attr:Str

y:Str

Void

Page 124: Static Verification for Web Scripting Languages

124

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Network Manager

request, …

JS Engine

eval, …

DOM

getAttr, setAttr, …

setAttr ::

elt:Element

attr:Str

{y:Str|CanWrite(elt,attr,y)}

Void

Page 125: Static Verification for Web Scripting Languages

125

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Network Manager

request, …

JS Engine

eval, …

DOM

getAttr, setAttr, …

Refined APIs Mediate Access

Typecheck Extension with Policy

Page 126: Static Verification for Web Scripting Languages

126

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

forall url.

not (url = “evil.com”)

WhiteListed (url)

var s = request(“evil.com”);

✗finite blacklist

Page 127: Static Verification for Web Scripting Languages

127

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

//: url:Str

var s = request(url);

✗might beblacklisted!

forall url.

not (url = “evil.com”)

WhiteListed (url)

Page 128: Static Verification for Web Scripting Languages

forall url.

not (url = “evil.com”)

WhiteListed (url)

128

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

if (url != “evil.com”) {

var s = request(url);

}

Page 129: Static Verification for Web Scripting Languages

129

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

if (url != “evil.com”) {

var s = request(url);

eval(s);

}

s:Str might be tainted!

forall url.

not (url = “evil.com”)

WhiteListed (url)

Page 130: Static Verification for Web Scripting Languages

130

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

if (url != “evil.com”) {

var s = request(url);

s = sanitize(s);

eval(s);

} ✓STATICALLY VERIFIED!

s:Str

{s:Str|not(Tainted(s))}

forall url.

not (url = “evil.com”)

WhiteListed (url)

Page 131: Static Verification for Web Scripting Languages

131

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

WhiteListed (“ny.com”)

WhiteListed (“golf.com”)

forall url.

WhiteListed (url)

not (Tainted (request (url)))

trust thatwhitelisted servers

return untainted strings

Page 132: Static Verification for Web Scripting Languages

132

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

var s = request(“ny.com”);

eval(s);✓ no need to sanitize

WhiteListed (“ny.com”)

WhiteListed (“golf.com”)

forall url.

WhiteListed (url)

not (Tainted (request (url)))

STATICALLY VERIFIED!

Page 133: Static Verification for Web Scripting Languages

133

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

forall e, oldUrl, newUrl.

ValueOf (e, “href”, oldUrl) ∧

StrPrefix (“newyorker.com”, oldUrl) ∧

StrPrefix (oldUrl, newUrl)

CanWrite (e, “href”, newUrl)

for (var elt in doc.getEltsByTagName(“a”)) {

var url = elt.getAttr(“href”);

if (url.match(/^newyorker.com/)) {

elt.setAttr(“href”, url + “?printable=true”);

} }

Page 134: Static Verification for Web Scripting Languages

134

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

ValueOf (elt, “href”, url) ∧

StrPrefix (“newyorker.com”, url) ∧

StrPrefix (url, url + “?printable=true”)

CanWrite (e, “href”, url+“?printable=true”)

for (var elt in doc.getEltsByTagName(“a”)) {

var url = elt.getAttr(“href”);

if (url.match(/^newyorker.com/)) {

elt.setAttr(“href”, url + “?printable=true”);

} }

Page 135: Static Verification for Web Scripting Languages

135

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

ValueOf (elt, “href”, url) ∧

StrPrefix (“newyorker.com”, url) ∧

StrPrefix (url, url + “?printable=true”)

CanWrite (e, “href”, url+“?printable=true”)

for (var elt in doc.getEltsByTagName(“a”)) {

var url = elt.getAttr(“href”);

if (url.match(/^newyorker.com/)) {

elt.setAttr(“href”, url + “?printable=true”);

} }

✓✓

Page 136: Static Verification for Web Scripting Languages

136

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

ValueOf (elt, “href”, url) ∧

StrPrefix (“newyorker.com”, url) ∧

StrPrefix (url, url + “?printable=true”)

CanWrite (e, “href”, url+“?printable=true”)

for (var elt in doc.getEltsByTagName(“a”)) {

var url = elt.getAttr(“href”);

if (url.match(/^newyorker.com/)) {

elt.setAttr(“href”, url + “?printable=true”);

} }

✓✓✓

Page 137: Static Verification for Web Scripting Languages

137

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

ValueOf (elt, “href”, url) ∧

StrPrefix (“newyorker.com”, url) ∧

StrPrefix (url, url + “?printable=true”)

CanWrite (e, “href”, url+“?printable=true”)

for (var elt in doc.getEltsByTagName(“a”)) {

var url = elt.getAttr(“href”);

if (url.match(/^newyorker.com/)) {

elt.setAttr(“href”, url + “?printable=true”);

} }

✓✓✓

✓STATICALLY VERIFIED!

Page 138: Static Verification for Web Scripting Languages

138

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

ValueOf (elt, “href”, url) ∧

StrPrefix (“newyorker.com”, url) ∧

StrPrefix (url, url + “?printable=true”)

CanWrite (e, “href”, url+“?printable=true”)

for (var elt in doc.getEltsByTagName(“a”)) {

var url = elt.getAttr(“href”);

if (url.match(/^newyorker.com/)) {

elt.setAttr(“href”, “evil.com”);

} }

Page 139: Static Verification for Web Scripting Languages

139

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

ValueOf (elt, “href”, url) ∧

StrPrefix (“newyorker.com”, url) ∧

StrPrefix (url, “evil.com”)

CanWrite (e, “href”, “evil.com”)

for (var elt in doc.getEltsByTagName(“a”)) {

var url = elt.getAttr(“href”);

if (url.match(/^newyorker.com/)) {

elt.setAttr(“href”, “evil.com”);

} }

Page 140: Static Verification for Web Scripting Languages

140

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

ValueOf (elt, “href”, url) ∧

StrPrefix (“newyorker.com”, url) ∧

StrPrefix (url, “evil.com”)

CanWrite (e, “href”, “evil.com”)

for (var elt in doc.getEltsByTagName(“a”)) {

var url = elt.getAttr(“href”);

if (url.match(/^newyorker.com/)) {

elt.setAttr(“href”, “evil.com”);

} }

✓✓✗

Page 141: Static Verification for Web Scripting Languages

141

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Types for Security+ JavaScript Verification

= Fine-Grained Web Security

[ESOP ’10, Guha et al. ’11]

[POPL ’12, OOPSLA ’12]

[current]

Secure Extensions Written in OCaml

Preliminary Benchmarks

Page 142: Static Verification for Web Scripting Languages

142

Why JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Guha et al. ’11]

Secure Extensions Written in OCamlPreliminary Benchmarks

Ported to DJS ~400 LOC so far

Well-typed programsdon’t have run-time errorsand conform to security policies

Page 143: Static Verification for Web Scripting Languages

143

OutlineWhy JavaScript? Security via LogicTypes via Logic Looking AheadChallenges

Security via Logic

Browser ExtensionsTypes for Fine-Grained Policies

Page 144: Static Verification for Web Scripting Languages

Why is JavaScript Important?Why is JavaScript Hard?

Static Types via LogicSecurity via Logic

Looking Ahead

144

OutlineWhy JavaScript? Types via Logic Security via Logic Looking AheadChallenges Security via Logic Looking Ahead

Page 145: Static Verification for Web Scripting Languages

145

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Dependent JavaScript

Untrusted

Code

ScriptingLanguages

Web Platform

>>>

Page 146: Static Verification for Web Scripting Languages

146

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Expressiveness

Usability

Verification

Dependent JavaScript (DJS)

TypeScriptLightweight (unsound) static checking tools becoming popular

Translate for additional checking

and IDE support

Page 147: Static Verification for Web Scripting Languages

147

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Dependent JavaScript

Untrusted

Code

ScriptingLanguages

Web Platform

ToolSupport

>>>

Page 148: Static Verification for Web Scripting Languages

148

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Web Development ToolsWay Behind Tools for Java, etc.

• Static Types in DJS Enable Refactoring,• Documentation Tools, Code Completion

• Web-Based Interfaces to Collect Statistics• about Programming Patterns, Errors

Page 149: Static Verification for Web Scripting Languages

149

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Dependent JavaScript

Untrusted

Code

ScriptingLanguages

ToolSupport

PolicySpecification

Web Platform

>>>

Page 150: Static Verification for Web Scripting Languages

150

Static Verification (DJS)

Security Expert

User

Developer must write policy

must read policy

and

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Page 151: Static Verification for Web Scripting Languages

151

Developer must write policy

• Infer from traces• Incentives from platform

must read policyUser

• Traces to demonstrate behavior• Community review-and-recommend services

must read policySecurity Expert

• Modeling tools to analyze policies

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Page 152: Static Verification for Web Scripting Languages

152

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Dependent JavaScript

Untrusted

Code

ScriptingLanguages

ToolSupport

PolicySpecification

DynamicEnforcement

Web Platform

>>>

Page 153: Static Verification for Web Scripting Languages

153

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Static Verification (DJS)

Security Expert

User

Developer

Page 154: Static Verification for Web Scripting Languages

154

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

eval(“…”);

…Dynamic

Code Loading

Impossible to statically analyzecode you don’t have!

Page 155: Static Verification for Web Scripting Languages

155

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Static Verification (DJS)

Security Expert

User

Developer

DynamicEnforcement

Page 156: Static Verification for Web Scripting Languages

156

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

DynamicEnforcement

eval(“…”);

//: #assume

New Types

Old Types

New Types

Page 157: Static Verification for Web Scripting Languages

157

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

eval(“…”);

//: #assume New Types

• Dynamic Checking• Staged Analysis [PLDI ’09]

DynamicEnforcement

Page 158: Static Verification for Web Scripting Languages

158

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Dependent JavaScript

Untrusted

Code

ScriptingLanguages

ToolSupport

PolicySpecification

DynamicEnforcement

Trust Base

Web Platform

>>>

Page 159: Static Verification for Web Scripting Languages

159

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Static Verification (DJS)

Security Expert

User

reviews only policy

Developer

DynamicEnforcement

Page 160: Static Verification for Web Scripting Languages

160

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Static Verification (DJS)

Security Expertreviews only policy

trust

trust SMTSolver

Page 161: Static Verification for Web Scripting Languages

Eliminate from TCB à laProof-Carrying Code [PLDI ’10]

Eliminate from TCB via Formal Verification

161

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Static Verification (DJS)

Security Expert

trust

SMTSolver

trust

Page 162: Static Verification for Web Scripting Languages

162

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Dependent JavaScript

Untrusted

Code

ScriptingLanguages

ToolSupport

PolicySpecification

DynamicEnforcement

Trust Base

Web PlatformStatic Types and Logic!

Page 163: Static Verification for Web Scripting Languages

163

Why JavaScript? Types via Logic Security via LogicChallenges Looking Ahead

Static Types and Logic!

Static Types for:Reliability / SecurityDevelopment ToolsPerformance• Additional Just-in-Time Optimizations• Compile to Custom Architectures

Page 164: Static Verification for Web Scripting Languages

164

Static Types and Logic!

Untrusted

Code

ScriptingLanguages

Concurrent Programs

Program Analysis via Set Constraints

[PLDI ’09]Run-Time Instrumentation[STOP ’11]

Dataflow Analysis and Race Detection

[PLDI ’08]

[ESOP ’10, PLDI ’10][POPL ’12, OOPSLA ’12]

Page 165: Static Verification for Web Scripting Languages

165

Thanks!

Scripting Languages are Pervasive

DJS: Precise Static Types via Logic

Towards Fine-Grained Web Security

ravichugh.com

Page 166: Static Verification for Web Scripting Languages

166