http cookie hijacking in the wild: security and privacy implications

42
HTTP Cookie Hijacking in the Wild: Security and Privacy Implications Suphannee Sivakorn*, Jason Polakis*, Angelos D. Keromytis *Joint primary authors

Upload: priyanka-aash

Post on 09-Jan-2017

150 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: HTTP cookie hijacking in the wild: security and privacy implications

HTTP Cookie Hijacking in the Wild: Security

and Privacy Implications

Suphannee Sivakorn*, Jason Polakis*,Angelos D. Keromytis

*Joint primary authors

Page 2: HTTP cookie hijacking in the wild: security and privacy implications

Who we areSuphannee Sivakorn

PhD Student @ Columbia University

Jason PolakisAssistant Professor @ University of Illinois at Chicago

Page 3: HTTP cookie hijacking in the wild: security and privacy implications

Current State of Affairsq Public discussion about need for encryption-Crypto Wars, part 2

q Getting crypto right is difficult-DROWN, FREAK, POODLE, Logjam, …

q SSL/TLS is fundamental for securing our communications

q Talk about encryption?Ø More about lack of encryptionØ “Web Services and our Quest for Finding Ubiquitous Encryption”

…sad tale without a happy ending … or partially happy?

Page 4: HTTP cookie hijacking in the wild: security and privacy implications

Chapters

Page 5: HTTP cookie hijacking in the wild: security and privacy implications

HTTP Threats Still Around

User tracking using third party cookies(Englehardt et al., WWW 2015)

Cookie injection attacks via HTTP response(Zheng et al., Usenix Security 2015)

Page 6: HTTP cookie hijacking in the wild: security and privacy implications

HTTP Cookie Hijacking

Web Service

HTTP Cookie HTTP

Page 7: HTTP cookie hijacking in the wild: security and privacy implications

HTTP Cookie Hijacking – Known Threat

Page 8: HTTP cookie hijacking in the wild: security and privacy implications

Migrating to HTTPS

~40% of top sites(140k) on the internet support HTTPS– SSL Pulse, 2016

Page 9: HTTP cookie hijacking in the wild: security and privacy implications

Oh, you thought it was encrypted?

Browser

Web Serverwww.google.com

Page 10: HTTP cookie hijacking in the wild: security and privacy implications

Oh, you thought it was encrypted?

Browser

Web Serverhttp://www.google.com

GET / HTTP/1.1

301/302 redirection https://

✓ HTTPS

Page 11: HTTP cookie hijacking in the wild: security and privacy implications

Oh, you thought it was encrypted?

Browser

Web ServerGET / HTTP/1.1

301/302 redirection https://

HTTPS communication

https://www.google.com

✓ HTTPS

Page 12: HTTP cookie hijacking in the wild: security and privacy implications

Oh, you thought it was encrypted?

Browser

Web Server

HTTPS communication

https://www.google.comHTTP Cookie

✓ HTTPS

GET / HTTP/1.1

301/302 redirection https://

Page 13: HTTP cookie hijacking in the wild: security and privacy implications

Cookie Hijacking in the Wild• Sites support HTTPS, but usually not ubiquitous

• Services offer personalization over HTTP• Complicated cookie inter-operability à Flawed access control

• Studied 25 major services from different categories• 15 have partial deployment of HTTPS• All 15 expose sensitive information and/or account functionality

Page 14: HTTP cookie hijacking in the wild: security and privacy implications

Threat Model

Page 15: HTTP cookie hijacking in the wild: security and privacy implications

What can we access using the stolen cookies?

Page 16: HTTP cookie hijacking in the wild: security and privacy implications

Stealing Cookies• Access to the targeted network

• Open Wi-Fi Network, Wiretapping, Middle box, Proxy, Tor exit node• Network traffic sniffing programs

• e.g. TCPdump, Wireshark, TShark, Kismet, KisMac• TCP Reassembly (if necessary)

Page 17: HTTP cookie hijacking in the wild: security and privacy implications

Stealing Cookies• Extracting Cookies

• Cookies in HTTP headers:• HTTP Request: Host, Cookie

• HTTP Response: Set-cookie

GET / HTTP/1.1Host: www.google.comConnection: keep-aliveCookie: SID=XXXXX; HSID=YYYYY; APISID=ZZZZZUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0Accept-Language: en-USAccept-Encoding: gzip, deflate

Set-cookie: SID=XXXXX; Expires=Mon, 01 Jan 1970 00:00:01 GMT; Path=/; Domain=.google.com;

Page 18: HTTP cookie hijacking in the wild: security and privacy implications

Accessing data using stolen cookies• Send HTTP or HTTPS Requests with the stolen cookies

• curl

• Web Driver, PhantomJS (Render Javascript, Images)• Find XPaths of elements or texts contain user information

• Differences size/elements/texts when loading page with cookie and without cookie

curl –H “User-Agent:” --cookie “name=value; name=value” http://example.com

Page 19: HTTP cookie hijacking in the wild: security and privacy implications

Search engines

• User informationemail, profile picture, first/last name

Google Bing YahooBaidu

Page 20: HTTP cookie hijacking in the wild: security and privacy implications

Search engines

• User informationemail, profile picture, first/lastname

• Search/visited history

Google Bing YahooBaidu

Page 21: HTTP cookie hijacking in the wild: security and privacy implications

Search engines

• User informationemail, profile picture, first/lastname

• Search/visited history• Saved locations

Google BingBaidu

Page 22: HTTP cookie hijacking in the wild: security and privacy implications

Yahoo• Many services

• Yahoo answers• Email notification

title and snippet• Extract contact list • Send email as user

Page 23: HTTP cookie hijacking in the wild: security and privacy implications

E-commerce

• All support HTTPS• HTTPS pages only for login, account and checkout pages• User information: username, email• Items in cart, wish list, recent view items, purchased items

Amazon Ebay Walmart Target

Page 24: HTTP cookie hijacking in the wild: security and privacy implications

E-commerce

• All support HTTPS• HTTPS pages only for login, account and checkout pages• User information: username, email• Items in cart, wish list, recent view items, purchased items• Ebay reveals shipping address

Amazon Ebay Walmart Target

Page 25: HTTP cookie hijacking in the wild: security and privacy implications

E-commerce

• All support HTTPS• HTTPS pages only for login, account and checkout pages• User information: username, email• Items in cart, wish list, recent view items, purchased items• Ebay reveals full shipping address• Facilitate spam and phishing

• Send recommendations to any email with custom message

Amazon Ebay Walmart Target

Page 26: HTTP cookie hijacking in the wild: security and privacy implications

Ad Networks• Ads presented to user based on user’s profile• Ads reveal browsing history and/or sensitive user data

shown to attackervisited by user

Page 27: HTTP cookie hijacking in the wild: security and privacy implications

Cookie Hijacking Cheat Sheet

Page 28: HTTP cookie hijacking in the wild: security and privacy implications

Collateral Exposure – Extensions & Mobile Apps

Collateral cookie exposure is common.Android apps a little more secure.

Page 29: HTTP cookie hijacking in the wild: security and privacy implications

Attack EvaluationØDo users behave differently when on public WiFi?ØAny mechanisms deployed that prevent hijacking?

• Monitored ~15% of Columbia’s public WiFi for 30 days (IRB approval)

• Collected HTTP and HTTPS traffic• URL / SNI• Cookie name• Hash of cookie value (differentiate users per website)

Page 30: HTTP cookie hijacking in the wild: security and privacy implications

Large-scale Cookie Exposure

In total, 282K vulnerable accounts

67k

9k 23k

1.6k

124k

Page 31: HTTP cookie hijacking in the wild: security and privacy implications

“Government agencies can collect HTTP traffic without notice to users or admins.”

– Edward Snowden

Page 32: HTTP cookie hijacking in the wild: security and privacy implications

Attack Implications – Tor Network• Used by privacy-conscious users, whistleblowers, activists• Tor Bundle is user-friendly

• HTTPS Everywhere pre-installed

• Monitored fresh Tor exit node for 30 days (IRB approval)• Did not collect cookies, only aggregate statistics

Page 33: HTTP cookie hijacking in the wild: security and privacy implications

Attack Implications – Tor Networkco

nnec

tions

~75% of connections over HTTPa practical deanonymization attack

Page 34: HTTP cookie hijacking in the wild: security and privacy implications

Countermeasures•

HTTPS Strict Transport Security (HSTS)HSTS Preload

HTTPS Everywhere

Server-controlled mechanisms

Client-controlled mechanisms

Page 35: HTTP cookie hijacking in the wild: security and privacy implications

HSTS• Server instructs browser to only communicate over HTTPS• HTTP response header sent over HTTPS

• HSTS Preload protects initial connection to server• Eliminates HTTP à HTTPS redirection

Strict-Transport-Security: max-age=10886400; includeSubdomains; preload

Page 36: HTTP cookie hijacking in the wild: security and privacy implications

HSTS: Issues✘ Preload requires HTTPS on all subdomains

Legacy URL and functionality

✘ HSTS partial adoptionMain google and regional pages (google.*) still not protected by HSTS

✘ Early state of adoption and misconfigurations [Kranch and Bonneau, NDSS 2015]

✘ Attacks [J. Selvi, BlackHat EU ‘14], [Bhargavan et al., Security and Privacy ’14]

google.com/accountgoogle.com/mail

account.google.commail.google.com

Protected Not protected

Page 37: HTTP cookie hijacking in the wild: security and privacy implications

HTTPS Everywhere• Browser extension from EFF and Tor• Pre-installed in Tor browser• Ruleset collections (community effort)

• Regular expressions rewrite “http://” to “https://”

http://example.com/foo à https://example.com/foo

<ruleset name=“Example”><target host=“example.com” /><rule from=“^http:” to “https:” /></ruleset>

Page 38: HTTP cookie hijacking in the wild: security and privacy implications

HTTPS Everywhere: Issues✘ Rulesets do not offer complete coverage (also contain human errors)✘ Not functional in some HTTPS pages/requests (exclusion rule)

Amazon: HTTPS breaks adding products to basket

✘ Complicated for large websites

✘ Opt-in option to reject all HTTP connections

<exclusion pattern="^http://(?:www\.)?amazon\.com/gp/twister/(?:ajaxv2|dynamic-update/)" />

http://rcm-images.amazon.com/images/foo.gif

https://images-na.ssl-images-amazon.com/images/foo.gif

Page 39: HTTP cookie hijacking in the wild: security and privacy implications

HTTPS Everywhere: Effectiveness • Extract URLs of HTTP requests

from WiFi dataset

• Test URLs against HTTPS Everywhere rulesets

• Over 70% accounts remain exposed

Page 40: HTTP cookie hijacking in the wild: security and privacy implications

Disclosure• Sent detailed reports to all audited web services

“Enabling HSTS … is something that we are actively working on as we speak.”

“The related tokens predate the existence of the HttpOnly setting and have several legacy

applications that do not support this setting. On newer applications we're working on new session management tokens that are marked as "Secure"

and "HttpOnly".”

“We have looked in the behavior of XXXXXXX cookie hijacking you

reported and can confirm that this is expected from the XXXXXXX Service

stack. We do not rely on the ‘XXXXXXX’ cookie for authentication purposes and as such authentication

would be required before visiting sensitive areas of an account.”

“In this case, we found the issue to be invalid as it is an accepted business risk.”

Page 41: HTTP cookie hijacking in the wild: security and privacy implications

Sound BytesØCookie hijacking remains a significant (yet overlooked?) threat.

ØServices sacrifice security for usability and support of outdated clients or legacy codebase.

ØExisting defenses are insufficient. They reduce the attack surface, but a single HTTP request is all you need!

Page 42: HTTP cookie hijacking in the wild: security and privacy implications

QuestionsFeel free to contact us:

[email protected]@cs.columbia.edu