Securing Browser Frame Navigation and Communication

19
Securing Browser Frame Navigation and Communication Adam Barth Collin Jackson John C. Mitchell Stanford University

description

Securing Browser Frame Navigation and Communication. Adam Barth Collin Jackson John C. Mitchell Stanford University. Outline. Frame Isolation Improving the frame navigation policy Frame Communication Fragment identifier messaging + authentication postMessage + confidentiality. Part I:. - PowerPoint PPT Presentation

Transcript of Securing Browser Frame Navigation and Communication

Page 1: Securing Browser Frame Navigation and Communication

Securing Browser Frame Navigation and Communication

Adam BarthCollin JacksonJohn C. Mitchell

Stanford University

Page 2: Securing Browser Frame Navigation and Communication

Outline• Frame Isolation

– Improving the frame navigation policy

• Frame Communication– Fragment identifier messaging + authentication– postMessage + confidentiality

Page 3: Securing Browser Frame Navigation and Communication

FRAME ISOLATIONPart I:

Page 4: Securing Browser Frame Navigation and Communication

Cross-Window Attack

window.open(“https://attacker.com/”, “awglogin”);

Page 5: Securing Browser Frame Navigation and Communication

Experiment to Determine Policy• Frame navigation policy not documented

– Some comments in Firefox source code, but misleading– No source code available for IE or Opera

• “Uber” frame navigation test case– Assumes policy invariants (e.g., left/right symmetric)– Attempts 176 navigations, records results– Extracted policy for Internet Explorer, Firefox, and Safari

Page 6: Securing Browser Frame Navigation and Communication

Policy Behavior

Permissive

Window

Descendant

Child

Policy Behavior

Page 7: Securing Browser Frame Navigation and Communication

Browser Frame Navigation PoliciesBrowser Policy

IE 6 (default) Permissive IE 6 (option) Child IE7 (no Flash) Descendant IE7 (with Flash) Permissive Firefox 2 Window Safari 3 Permissive Opera 9 Window HTML 5 Child

Page 8: Securing Browser Frame Navigation and Communication

Window Policy Anomaly

top.frames[1].location = “http://www.attacker.com/...”;top.frames[2].location = “http://www.attacker.com/...”;

...

Page 9: Securing Browser Frame Navigation and Communication

Principle: Pixel Delegation• Frames delegate screen pixels

– Child cannot draw outside its frame– Parent can draw over the child’s pixels

• Navigation similar to drawing– Navigation replaces frame contents– “Simulate” by drawing over frame

• Policy ought to match pixel delegation– Navigate a frame if can draw over the frame

Page 10: Securing Browser Frame Navigation and Communication

Solution: Descendant Policy• Best security / compatiblity trade-off

– Security: Respects pixel delegation– Compatibility: Least restrictive such policy

• Implementation– Wrote patches for Firefox and Safari– Wrote over 1000 lines of regression tests

• Deployment– Apple released patch as security update– Mozilla will ship policy in Firefox 3

Page 11: Securing Browser Frame Navigation and Communication

Adoption of Descendant PolicyBrowser Policy

IE7 (no Flash) Descendant IE7 (with Flash) Descendant Firefox 3 Descendant Safari 3 Descendant Opera 9 ? HTML 5 Descendant

Page 12: Securing Browser Frame Navigation and Communication

Subtlety: Scripting Policy Interaction• Is this permissible?

– Target is not descendant

• Can draw over pixels1) Inject script into parent2) Parent draws the pixels

• Allow navigation– canScript o canDraw– Large compatibility win– No security loss

a.com

b.com

a.com

Page 13: Securing Browser Frame Navigation and Communication

FRAME COMMUNICATIONPart II:

Page 14: Securing Browser Frame Navigation and Communication

Fragment Identifier Messaging

• Send information by navigating a frame– http://gadget.com/#hello

• Navigating to fragment doesn’t reload frame– No network traffic, but frame can read its fragment

• Not a secure channel– Confidentiality– Integrity– Authentication

Page 15: Securing Browser Frame Navigation and Communication

Fix: Improve the protocol

• Proposed Needham-Schroeder-Lowe

• Adoption– Microsoft: Windows Live Channels library– IBM: OpenAjax Hub 1.1

Page 16: Securing Browser Frame Navigation and Communication

postMessage

• New API for inter-frame communication• Supported in latest betas of many browsers

• Not a secure channel– Confidentiality– Integrity– Authentication

Page 17: Securing Browser Frame Navigation and Communication

Reply Attack

Page 18: Securing Browser Frame Navigation and Communication

Fix: Improve the API

• Let the sending specify the recipientframe[0].postMessage("Hello", "http://gadget.com")

– Can use "*" if confidentiality not required

• Adoption– Firefox 3– Internet Explorer 8– Safari 3.1

Page 19: Securing Browser Frame Navigation and Communication

Summary

• All proposals deployed to real users • Frame isolation

– Improved frame navigation policy• Fixed Guninski and Gadget Hijacking

– Drive-by-downloads still a concern…

• Frame communication– Secured fragment identifier messaging– Secured new postMessage API