Top Banner
1 Detecting Logic Vulnerabilities in E-Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of William & Mary
31

1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

Dec 22, 2015

Download

Documents

Beatrix Baldwin
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: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

1

Detecting Logic Vulnerabilities in E-Commerce Applications

Presenter: Liu YinSlides Adapted from Fangqi Sun

Computer Science DepartmentCollege of William & Mary

Page 2: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

2

Outline Introduction

Logic Vulnerabilities in E-Commerce Web Applications Key Challenge Related Work

Attack Examples Approach

Definitions Taint Rules Vulnerability Detection Example Vulnerability Detection Algorithm

Implementation Evaluation Conclusion

Page 3: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

3

Logic Vulnerabilities in E-Commerce Web Applications

Third-party cashiers Bridge the trustiness gap

between customers and merchants

Complicate logic flows during checkout

Logic vulnerabilities Both track payment status,

miscommunication Insufficient or missing checks

on payment status Purchase with incorrect or no

payment

User

Merchant

CashierPayment of order total in currency for order ID to merchant ID

Page 4: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

4

Key Challenge Logic vulnerabilities in e-commerce web applications are

application-specific Thorough code review of all possible logic flows is non-trivial Various application-specific logic flows, cashier APIs and security

checks make automated detection difficult

Key challenge of automated detection

Page 5: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

5

Related Work Wang et al. [30, 33]

First to perform security analysis on Cashier-as-a-Service based e-commerce applications.

Found several serious logic vulnerabilities in a few popular e-commerce applications via manual code reviews

Proposed a proxy-based approach to dynamically secure third-party web service integrations which include the integration of cashiers

This paper provide an application-independent invariant propose the first static analysis to detect logic vulnerabilities

Page 6: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

6

Key Insight A common invariant for automated detection

Page 7: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

7

Outline Introduction

Logic Vulnerabilities in E-Commerce Web Applications Key Challenge Related Work

Attack Examples Approach

Definitions Taint Rules Vulnerability Detection Example Vulnerability Detection Algorithm

Implementation Evaluation Conclusion

Page 8: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

8

Attack on Currency

Page 9: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

9

Attack on Order ID

Page 10: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

10

Attack on Merchant ID

Page 11: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

11

Illustrative Example

Payment module Luottokunta (version 1.3)

Page 12: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

12

Outline Introduction

Logic Vulnerabilities in E-Commerce Web Applications Key Challenge Related Work

Attack Examples Approach

Definitions Taint Rules Vulnerability Detection Example Vulnerability Detection Algorithm

Implementation Evaluation Conclusion

Page 13: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

13

Approach Combines symbolic execution and taint analysis

to detect violations of the invariant by tracking tainted payment status and analyzing critical logic flows among merchants, cashiers and users.

A symbolic execution framework that explores critical control flows exhaustively

Tracking taint annotations for the critical components Payment status

Order ID, Order total, Merchant ID, Currency Exposed signed token

An encrypted value that is signed with a cashier-merchant secret Act as cashier’s signature

 

Page 14: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

14

Approach - Definitions Merchant Cashier User Logic Flows in E-commerce Applications :

Communications between merchant nodes, cashier nodes and user.  represented as II = {(ni , Qi) -> (nj , Qj) | 0 <i , j<k}.

Logic State Consists of taint annotations and links to other valid nodes of a checkout

process. Logic state stores taint annotations for the following payment status

components and exposed signed tokens.( OrderID, OrderTotal, MerchantID, Currency, exposed signed tokens( Secret_key ) )

Logic Vulnerabilities in E-commerce Applications Exists when for any accepted order ID, the merchant cannot verify that

the user has correctly paid the cashier the amount of order total in the expected currency to merchant ID.

Page 15: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

15

Taint Removal RulesInitially all tainted. When correctly verifies the taint should be removed Conditional checks of (in)equality

When an untrusted value is verified against a trusted one Example of removing taint from order total

md5(SECRET . $_SESSION[‘order’] [‘total’]) == md5(SECRET . $_GET[‘oTotal’])

Writes to merchant databases When an untrusted value is included in an INSERT/UPDATE

query Merchant employee can easily spot tampered values

Secure communication channels For synchronous merchant-to-cashier cURL requests Remove when payment components are present in request parameters Synchronous requests are sent via secure communication channels,

guarantee the authenticity of payment status

Page 16: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

16

Taint Addition Rules When a conditional check for a cashier-to-merchant

request relies on an exposed signed token, add taint to the exposed signed token.

Example Hidden HTML form element: md5($secret . $orderId . $orderTotal) $_GET['hash'] == md5($secret . $_GET['oId'] . $_GET['oTotal']) This exposed signed token md5($secret . $orderId . $orderTotal)

nullifies checks on order ID and order total

Page 17: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

17

Vulnerability Detection Example

Page 18: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

18

Page 19: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

19

Page 20: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

20

Vulnerability Detection Algorithm It integrates symbolic execution of merchant nodes

and taint analysis, and connects individual nodes to explore valid logic flows in e-commerce applications.

Page 21: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

21

Page 22: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

22

Outline Introduction

Logic Vulnerabilities in E-Commerce Web Applications Key Challenge Related Work

Attack Examples Approach

Definitions Taint Rules Vulnerability Detection Example Vulnerability Detection Algorithm

Implementation Evaluation Conclusion

Page 23: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

23

ImplementationA symbolic execution framework that integrates taint analysis for PHP

Page 24: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

24

Outline Introduction

Logic Vulnerabilities in E-Commerce Web Applications Key Challenge Related Work

Attack Examples Approach

Definitions Taint Rules Vulnerability Detection Example Vulnerability Detection Algorithm

Implementation Evaluation Conclusion

Page 25: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

25

Evaluation Subjects: 22 unique payment modules of osCommerce

More than 14,000 registered websites, 928 payment modules, 13 years of history (osCommerce v2.3)

20 out of 46 default modules with distinct CFGs 2 Luottokunta payment modules (v1.2 & v1.3)

Metrics Effectiveness: Detected 12 logic vulnerabilities (11 new) with no false

positives Performance

Page 26: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

26

Page 27: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

27

Page 28: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

28

Page 29: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

29

Outline Introduction

Logic Vulnerabilities in E-Commerce Web Applications Key Challenge Related Work

Attack Examples Approach

Definitions Taint Rules Vulnerability Detection Example Vulnerability Detection Algorithm

Implementation Evaluation Conclusion

Page 30: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

30

Conclusion First static detection of logic vulnerabilities in e-

commerce applications Based on an application-independent invariant A scalable symbolic execution framework for PHP applications,

incorporating taint tracking of payment status

Three responsible proof-of-concept experiments on live websites

Evaluated our tool on 22 unique payment modules and detected 12 logic vulnerabilities (11 are new)

Page 31: 1 Detecting Logic Vulnerabilities in E- Commerce Applications Presenter: Liu Yin Slides Adapted from Fangqi Sun Computer Science Department College of.

31

End

Thanks!Q&A