56
InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing (Indiana University) Yangyi Chen (Indiana University) XiaoFeng Wang (Indiana University) Shuo Chen (Microsoft Research)

InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

InteGuard: Toward Automatic Protection of

Third-Party Web Service Integrations

Luyi Xing (Indiana University) Yangyi Chen (Indiana University)

XiaoFeng Wang (Indiana University) Shuo Chen (Microsoft Research)

Page 2: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

INTRODUCTION

Page 3: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

•  Web applications integrate third-party Web services.

1. Introduction

Introduction

Page 4: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

•  Web applications integrate third-party Web services.

1. Introduction

Introduction

Page 5: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

•  Security challenge: coordinate Website (Integrator), Service Provider and Web Client.

•  Integrator error-prone, difficult to be secure ([Oakland’11, Oakland’12]).

1. Introduction

Introduction-cont.

Page 6: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Introduction-Cont. •  Protection

1. Introduction

  Integrator side more error-prone.   Traffic among integrator, provider and clients is

generally mechanic.

Page 7: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

BACKGROUND

Page 8: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Background •  Third-Party Web Service Integration

 RT (HTTP request/response pair, or HTTP Round Trip)

2. Background

(e.g. Bestbuy.com, Newegg.com)

(e.g. shopper)

(e.g. PayPal)

Page 9: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Logic Flaws

RT1.request = https://Jeff.com/placeOrder

RT2.request = https://PayPal/pay?amount=9.99&&orderID=123 AccountId=alice&sig=cde

RT3.request = https://alice.com/finishOrder?gross=9.99&orderID=123 &[email protected] AccountId = bob payeeEmail =

[email protected] 2. Background

Page 10: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Previous Research

•  Web Logic Flaws.  Swift, Ripley, Swaddler, MiMoSA, Waler,

Rolecast, Execution After Redirect, SAFERPHP, WAPTEC, APP_LogGIC, Fix_Me_Up, NoTamper, Block

•  Conventional two-party settings (websites, clients).

2. Background

Page 11: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Adversary Model •  Logic flaws in Integration •  Service provider is trusted •  Client is not trusted

2. Background

Page 12: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Contribution •  Integuard

  First step toward automatic and generic protection of Web service integrations.

 New challenges in multiple-party settings.  Effective false positive control.  Evaluate with real exploits and performance test.  Practical protection.

2. Background

Page 13: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

DESIGN

Page 14: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Architecture

3. Design

Page 15: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Integuard

Design – Architecture

3. Design

Page 16: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Training Trace Collection

3. Design

•  Traces Security Invariants •  Challenge

 Random transactions for invariant extraction False Positive

Page 17: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Different users Different products Different quantities Different addresses

Design – Training Trace Collection

3. Design

•  Four traces •  Integrator opens two accounts at service provider,

e.g. open two PayPal Merchant accounts Different transactions Same integrator Integrator 1 and Integrator 2 are

the same Web application, configured with different

merchant accounts

Page 18: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Training Trace Collection

3. Design

•  Four traces

Same user Same products Same quantity Same address

Same transactions Different integrators

Page 19: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Training Trace Collection

3. Design

•  Four traces

Same Transactions Different Integrators

Page 20: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Training Trace Collection

3. Design

•  Four traces

Differential Analysis

Page 21: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Invariant Analysis

3. Design

•  Integrator-specific invariant •  Local Invariant

  Transaction-specific invariant •  Other invariant

 Start of transaction  End of transaction  API sequence

Page 22: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Invariant Analysis

3. Design

•  Integrator-specific invariant •  Local Invariant

  Transaction-specific invariant •  Other invariant

 Start of transaction  End of transaction  API sequence

Page 23: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

3. Design

Integrator-Specific Invariant: RT3.payeeEmail

[email protected] Specific to Integrator 1

[email protected] Specific to Integrator 2

Page 24: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

3. Design

Drop such Invariant

payMethod = creditCard

Page 25: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Invariant Analysis

3. Design

•  Integrator-specific invariant •  Local Invariant

  Transaction-specific invariant •  Other invariant

 Start of transaction  End of transaction  API sequence

Page 26: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Local Invariant: amount == gross

amount = gross

amount = gross

amount = gross

amount = gross

3. Design

Page 27: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Drop Invariant With

Length < 3

returnFlag = status

returnFlag = status

returnFlag = status

returnFlag = status

3. Design

Page 28: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Invariant Analysis •  Integrator-specific invariant •  Local Invariant

  Transaction-specific invariant •  Other invariant

 Start of transaction  End of transaction  API sequence

3. Design

Page 29: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

transactionID ==

orderID

3. Design

Page 30: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Specific to each

transaction

0519

0520

0521

0522

3. Design

Page 31: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Local Invariant

Transaction specific invariant

3. Design

Page 32: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Same transactions Different integrators

9.99

9.99

amount = gross

3. Design

Page 33: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Transaction-specific Invariant

Is RT4 different?

3. Design

Page 34: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Transaction-specific Invariant

3. Design

RT4 has no cookies

Page 35: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Transaction-specific Invariant

3. Design

Which transaction does a RT4 belong to?

Page 36: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Transaction-specific Invariant

3. Design

Transaction-specific Invariants help

Grouping RT4 into its belonging transaction

Page 37: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Invariant Analysis

3. Design

•  Local Invariant •  Integrator-specific invariant

  Transaction-specific invariant •  Other invariant

 Start of transaction  End of transaction  API sequence

Page 38: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Element Extraction

3. Design

•  Challenges  RT2 not observable  RT2 parameters in RT1’s response  Channels: HTTP 3xx, meta refresh, HTML Form,

JavaScript, JSON, XML

Redirection

Integuard

Page 39: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Element Extraction

3. Design

•  Challenges  RT2 not observable  RT2 parameters in RT1’s response  Channels: HTTP 3xx, meta refresh, HTML Form,

JavaScript, JSON, XML

Redirection

Integuard

Page 40: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Element Extraction

3. Design

From RT1, extract RT2’s parameters Record the DOM locations for each parameter

•  RT2 parameters in RT1’s response

Page 41: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Element Extraction

3. Design

Don’t parse all content of RT1

Page 42: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Element Extraction

3. Design

Just extract desired parameters from known locations

Page 43: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Element Extraction •  HTTP 3xx •  Meta refresh •  JavaScript

 Abstract Syntax Tree (AST) •  JSON •  XML

3. Design

Page 44: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Element Extraction •  RT2’s parameters in RT1’s response

 HTTP 3xx  Meta refresh   JavaScript   JSON  XML

3. Design

Page 45: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Element Extraction •  JavaScript

 Abstract Syntax Tree (AST)  Mark parameters’ locations

•  JSON, XML   Tree structure, mark locations

3. Design

Page 46: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Design – Security Policy Enforcement •  Security invariants. •  Intercept HTTP traffic on integrator. •  Runtime detection of invariant.

3. Design

Integuard

Page 47: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

EVALUATION

Page 48: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Evaluation

4. Evaluation

•  Integrations  Web Shopping Cart applications with known

vulnerabilities. o  Intersipre starter edition 5.5.4 o  Nopcommerce v1.60

  5 faulty SSO integrations. o  involving sears.com, janrain.com, Google,

Facebook, PayPal

Page 49: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Effectiveness

4. Evaluation

•  Effectiveness Application Service Integrated Invariant type Detected

Nopcommerce PayPal Std Local Yes Nopcommerce Amazon Simple Pay Integrator-specific Yes Nopcommerce Amazon Simple Pay Integrator-specific Yes

Interspire PayPal Std Transaction-specific Yes Interspire PayPal Exp Local Yes Interspire Google Checkout API Sequence Yes

Smartsheet.com Google ID Local Yes Janrain Google ID Local Yes

Sears.com Facebook SSO Integrator-specific Yes Shopgecko.com PayPal Access Local Yes

Farmville Facebook SSO N/A No

Page 50: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

False Positives

4. Evaluation

•  Each CaaS integration, 100 to 300 checkouts. •  Each SSO integration, 20 checkouts. •  Altogether 1,000 real transactions.

 Random user behaviors, clicking back button, returning through old URLs, etc.

 Randomly crawl URLs.

No false alarms

Page 51: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

Performance

4. Evaluation

•  32 to 256 (default MaxClients of Apache Web server) concurrent transactions.

•  Negligible overhead (3.32%). •  Memory:

 Almost constant 1,250 MB . (32 to 256 concurrency)

  150MB difference. (256 concurrency, with and without security check)

Page 52: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

CONCLUSION

Page 53: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

•  First to protect vulnerable integrations of third-party Web services.

•  New challenges in multi-party settings. •  Generate invariants through a suit of new techniques. •  Effective false positive control and low performance

expense.

5. Conclusion

Conclusion

Page 54: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

THANK YOU!

LUYI XING

Page 55: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing
Page 56: InteGuard: Toward Automatic Protection of Third … › wp-content › uploads › 2017 › ...InteGuard: Toward Automatic Protection of Third-Party Web Service Integrations Luyi Xing

ICAP

  The Internet Content Adaptation Protocol (ICAP) is a lightweight HTTP-like protocol which is used to extend transparent proxy servers. ICAP is generally used to implement virus scanning and content filters (including censorware) in transparent HTTP proxy caches.