32
Cross-Site Search (XS-Search) Attacks Hemi Leibowitz, OWASP AppSec IL 2015 1

Cross-Site Search (XS-Search) Attacks

  • Upload
    trantu

  • View
    219

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Cross-Site Search (XS-Search) Attacks

Cross-Site Search (XS-Search) AttacksHemi Leibowitz, OWASP AppSec IL 2015 1

Page 2: Cross-Site Search (XS-Search) Attacks

Work By:

Nethanel Gelernter:Head of the cyber research group at the Michlala LeMinhal.

Professor Amir Herzberg:Head of the Secure Communication and Computing (`Cyber`) group at Bar-Ilan University

2

Page 3: Cross-Site Search (XS-Search) Attacks

AGENDA

Extraction of private, sensitive data using cross-site

vulnerabilities via XS-Search attacks

➢ Who, what, how?

➢ Demo

➢ Conclusions

* All experiments were performed ethically

3

Page 4: Cross-Site Search (XS-Search) Attacks

VULNERABLE SITES AND DATA

And a lot more...

Mail content, contacts...

Structured information

Search history

Relationships

4

Page 5: Cross-Site Search (XS-Search) Attacks

EXAMPLE SCENARIO

GET / POST request to GmailBrowser receives the response and displays it

5

Page 6: Cross-Site Search (XS-Search) Attacks

Cross-Site Attacks

6

Page 7: Cross-Site Search (XS-Search) Attacks

XS-SEARCH: HIGH LEVEL VIEW

Response

GET/POST request

…<script>...

7

Page 8: Cross-Site Search (XS-Search) Attacks

XS-SEARCH: HIGH LEVEL VIEW

Response

GET/POST request

…<script>...

Allowed

8

Page 9: Cross-Site Search (XS-Search) Attacks

XS-SEARCH: HIGH LEVEL VIEW

Response

GET/POST request

…<script>...

SOP

9

Page 10: Cross-Site Search (XS-Search) Attacks

Timing Side ChannelWe can’t read the response, BUT - we can measure how long it took

10

Page 11: Cross-Site Search (XS-Search) Attacks

XS-SEARCH: HIGH LEVEL VIEW

Response

GET/POST request

…<script>...

{Time

11

Page 12: Cross-Site Search (XS-Search) Attacks

PROBLEMS

1. Noise -

a. Timing a response is inaccurate and influenced by

many factors (Internet connection, Browser etc.)

b. Very (very) short time differences between

responses (even long ones) - especially when heavily

compressed.

2. Small window of opportunity -

a. User visits the page for a short term only

b. Avoid detection mechanisms (anti-DoS)12

Page 13: Cross-Site Search (XS-Search) Attacks

“These XS-Search attacks

are impractical

13

Page 14: Cross-Site Search (XS-Search) Attacks

XS-SEARCH: BASIC FLOW

Dummy - request that yields a short (fast) response

q=in:sent&from:fdjakdhasd

Challenge - request that yields either long or short response

q=in:sent&from:Alice

14

Page 15: Cross-Site Search (XS-Search) Attacks

BASIC FLOW: ANSWER BOOLEAN QUESTIONS

T(Dummy) ≈ T(Challenge) ⇒ False

T(Dummy) ≪ T(Challenge) ⇒ True

15

Page 16: Cross-Site Search (XS-Search) Attacks

XS-SEARCH: BASIC FLOW

16

Page 17: Cross-Site Search (XS-Search) Attacks

XS-SEARCH: BASIC FLOW

Unknown response

GET q=in:sent&from:fdjakdhasd …<script>...

{T(Dummy) Empty response

GET q=in:sent&from:Alice

{T(Challenge) ?

17

Page 18: Cross-Site Search (XS-Search) Attacks

DEALING WITH THE PROBLEMS

➢ Dummy / Challenge pairs

➢ Statistical tests

➢ Inflation techniques

➢ Divide and Conquer algorithms

18

Page 19: Cross-Site Search (XS-Search) Attacks

STATISTICAL TESTS

Classical statistical hypothesis tests assume large samples.

In order to achieve good results using small samples:

➢ Ran each Dummy / Challenge pair a few times

➢ Tested and compared various statistical tests between

the distributions

Main observation: lower values give better indication

19

Page 20: Cross-Site Search (XS-Search) Attacks

INFLATION TECHNIQUES

Increase the difference of the response time

between empty and full response

➢ Response-length inflation

○ Query fields are copied to the response

➢ Compute-time inflation

20

Page 21: Cross-Site Search (XS-Search) Attacks

RESPONSE-LENGTH INFLATION

21

Page 22: Cross-Site Search (XS-Search) Attacks

COMPUTE-TIME INFLATION

➢ Abuses hard-to-compute ‘has not’ search terms

➢ Short circuit ‘empty’ queries

➢ Allows detection of information that appears only once!

22

Page 23: Cross-Site Search (XS-Search) Attacks

COMPUTE-TIME INFLATION

➢ Abuses hard-to-compute ‘has not’ search terms

➢ Short circuit ‘empty’ queries

➢ Allows detection of information that appears only once!

Dummy:

q=in:sent&from:fdjakdhasd&hasnot:{rjew+...+iqejh}

Challenge:

q=in:sent&from:Alice&hasnot:{rjew+...+iqejh}23

Page 24: Cross-Site Search (XS-Search) Attacks

EFFICIENT TERM IDENTIFICATION

Which of {T1, T2,…} appears in <data>?

Naïve solution: check one by one…

Three efficient divide and conquer algorithms:

➢ Multiple Terms Identification (MTI)

➢ Optimized Multiple Terms Identification (OMTI)

➢ Any Term Identification (ATI)

Each of them sends queries for conjunction of terms

from:michael+OR+dan+OR+.... Up to the URL limit24

Page 25: Cross-Site Search (XS-Search) Attacks

DEMO

25

Page 26: Cross-Site Search (XS-Search) Attacks

WHAT CAN WE EXPOSE WITH XS-SEARCH?

➢ Specific terms or from list of candidate terms

➢ By date, subject, folder, or other properties

➢ Structured information

○ Credit card numbers (xxxx-xxxx-xxxx-xxxx)

○ Phone numbers (xxx-xxxx-xxx)

26

Page 27: Cross-Site Search (XS-Search) Attacks

WHAT CAN WE EXPOSE WITH XS-SEARCH?

➢ Does the name of the user is Alice?

○ in:sent&from:alice

➢ Closely related to [email protected]?

[email protected]&st=100

➢ Is a client of SomeBank?

[email protected]

➢ Do have Bob as a friend in Google+?

○ from:bob&circle:friends

➢ Did Bob bcc Charlie about an amazing lecture?!

○ from:bob&bcc:charlie&after:2015/10/12+before:

2015/10/14&subject:amazing-xssearch-lecture27

Page 28: Cross-Site Search (XS-Search) Attacks

WHAT CAN WE EXPOSE WITH XS-SEARCH?

Credit card numbers (xxxx-xxxx-xxxx-xxxx)

➢ x ∈ {0,1...9} ⇒ 1016 =

10,000,000,000,000,000

But, using XS-Search we only need to reveal xxxx

➢ Only 104 (= 10,000) possibilities!28

Page 29: Cross-Site Search (XS-Search) Attacks

PREVENTING XS-SEARCH?

29

Page 30: Cross-Site Search (XS-Search) Attacks

PREVENTING XS-SEARCH?

Easy - prevent any cross-site request.

BUT…

Many services wish to allow cross-site requests.

These services can try to:

➢ Restrict: limit requests rate, inflation …

➢ Detect: anomalies, heuristics...30

Page 31: Cross-Site Search (XS-Search) Attacks

Thanks!Any questions?

You can find me at:

[email protected]

31

Page 32: Cross-Site Search (XS-Search) Attacks

Credits

Special thanks to all the people who made and released these awesome resources for free:

▷ Presentation template by SlidesCarnival▷ Photographs by Unsplash

32