29.11.2012 Views

2nd USENIX Conference on Web Application Development ...

2nd USENIX Conference on Web Application Development ...

2nd USENIX Conference on Web Application Development ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.3 Other extensi<strong>on</strong> models<br />

4.3.1 Extensi<strong>on</strong>s to applicati<strong>on</strong> UI<br />

Internet Explorer 4.0 introduced two extensi<strong>on</strong> points permitting<br />

customized toolbars (Explorer Bars) and c<strong>on</strong>textmenu<br />

entries. These extensi<strong>on</strong>s were written in native C++<br />

code, had full access to the browser’s internal DOM representati<strong>on</strong>s,<br />

and could implement essentially any functi<strong>on</strong>ality<br />

they chose. Unsurprisingly, early extensi<strong>on</strong>s often<br />

compromised the browser’s security and stability. IE 8<br />

later introduced two new extensi<strong>on</strong> points that permitted<br />

self-updating bookmarks of web-page snippets (<strong>Web</strong><br />

Slices) and c<strong>on</strong>text-menu items to speed access to repetitive<br />

tasks (Accelerators), providing safer implementati<strong>on</strong>s<br />

of comm<strong>on</strong> uses for Explorer Bars and c<strong>on</strong>text menus.<br />

The majority of IE’s interface is not modifiable by extensi<strong>on</strong>s.<br />

By c<strong>on</strong>trast, Firefox explored the possibility<br />

that entire applicati<strong>on</strong> interfaces could be implemented<br />

in a markup language, and that a declarative extensi<strong>on</strong><br />

mechanism could overlay those UIs with new c<strong>on</strong>structi<strong>on</strong>s.<br />

Research projects such as Perspectives change the<br />

way Firefox’s SSL c<strong>on</strong>necti<strong>on</strong> errors are presented, while<br />

others such as Xmarks or Weave synchr<strong>on</strong>ize bookmarks<br />

and user settings between multiple browsers. The UI for<br />

these extensi<strong>on</strong>s is written in precisely the same declarative<br />

way as Firefox’s own UI, making it as simple to<br />

extend Firefox’s browser UI as it is to design any website.<br />

But the single most compelling feature of these extensi<strong>on</strong>s<br />

is also their greatest weakness: they permit implementing<br />

features that were never anticipated by the<br />

browser designers. End users can then install multiple<br />

such extensi<strong>on</strong>s, thereby losing any assurance that the<br />

composite browser is stable, or even that the extensi<strong>on</strong>s<br />

are compatible with each other. Indeed, Chrome’s carefully<br />

curtailed extensi<strong>on</strong> model is largely a reacti<strong>on</strong> to the<br />

instabilities often seen with Firefox extensi<strong>on</strong>s. Chrome<br />

permits extensi<strong>on</strong>s <strong>on</strong>ly minimal change to the browser’s<br />

UI, and prevents interacti<strong>on</strong>s between extensi<strong>on</strong>s. For<br />

comparis<strong>on</strong>, Chrome directly implements bookmarks<br />

and settings synchr<strong>on</strong>izati<strong>on</strong>, and now permits extensi<strong>on</strong><br />

c<strong>on</strong>text-menu acti<strong>on</strong>s, but the Perspectives behavior remains<br />

unimplementable by design.<br />

Our design for overlays is based str<strong>on</strong>gly <strong>on</strong> Firefox’s<br />

declarative approach, but provides str<strong>on</strong>ger semantics for<br />

overlays so that we can detect and either prevent or correct<br />

c<strong>on</strong>flicts between multiple extensi<strong>on</strong>s. We also generalized<br />

several details of Firefox’s overlay mechanism for<br />

greater c<strong>on</strong>venience, without sacrificing its analyzability.<br />

4.3.2 Extensi<strong>on</strong>s to scripts<br />

In tandem with the UI extensi<strong>on</strong>s, almost the entirety<br />

of Firefox’s UI behaviors are driven by JS, and again<br />

extensi<strong>on</strong>s can manipulate those scripts to customize<br />

12<br />

those behaviors. A similar ability lets extensi<strong>on</strong>s modify<br />

or inject scripts within web pages. Extensi<strong>on</strong>s such as<br />

LastTab change the tab-switching order from cyclic to<br />

most-recently-used, while others such as Ghostery block<br />

so-called “web tracking bugs” from executing. Firefox<br />

exposes a huge API, opening basically the entire platform<br />

to extensi<strong>on</strong> scripts. This flexibility also poses a<br />

problem: multiple extensi<strong>on</strong>s may attempt to modify the<br />

same scripts, often leading to broken or partially-modified<br />

scripts with unpredictable c<strong>on</strong>sequences.<br />

Modern browser extensi<strong>on</strong> design, like Firefox’s Jetpack<br />

or Chrome’s extensi<strong>on</strong>s, are typically developed<br />

using HTML, JS, and CSS. While Firefox “jetpacks” are<br />

currently still fully-privileged, Chrome extensi<strong>on</strong>s run<br />

in a sandboxed process. Chrome extensi<strong>on</strong>s cannot access<br />

privileged informati<strong>on</strong> and cannot crash or hang the<br />

browser. While these new guarantees are necessary for the<br />

stability of a commercial system protecting valuable user<br />

informati<strong>on</strong>, they also restrict the power of extensi<strong>on</strong>s.<br />

One attempt to curtail these scripts’ interacti<strong>on</strong>s with<br />

each other within web pages is the Fine project [6]. Instead<br />

of directly using JS, the authors use a dependentlytyped<br />

programming language to express the precise readand<br />

write-sets of extensi<strong>on</strong> scripts, and a security policy<br />

c<strong>on</strong>strains the informati<strong>on</strong> flow between them. Extensi<strong>on</strong>s<br />

that satisfy the security policy are provably n<strong>on</strong>c<strong>on</strong>flicting.<br />

The Fine project can target C3 easily, either<br />

by compiling its scripts to .Net assemblies and loading<br />

them dynamically (by subclassing the 〈script/〉 tag), or<br />

by statically compiling its scripts to JS and dynamically<br />

injecting them into web c<strong>on</strong>tent (via the JS global-object<br />

hook). Guha et al. successfully ported twenty Chrome<br />

extensi<strong>on</strong>s to Fine and compiled them to run <strong>on</strong> C3 with<br />

minimal developer effort.<br />

As menti<strong>on</strong>ed earlier, C3 includes our prior work <strong>on</strong><br />

aspect-oriented programming for JS [10], permitting extensi<strong>on</strong>s<br />

clearer language mechanisms to express how<br />

their modificati<strong>on</strong>s apply to existing code. Bey<strong>on</strong>d the<br />

performance gains and clarity improvements, by eliminating<br />

the need for brittle mechanisms and exposing the<br />

intent of the extensi<strong>on</strong>, compatibility analyses between<br />

extensi<strong>on</strong>s become feasible.<br />

4.4 Security c<strong>on</strong>siderati<strong>on</strong>s<br />

Of the five implemented extensi<strong>on</strong> points, two are written<br />

in .Net and have full access to our DOM internals. In<br />

particular, new DOM nodes or new JS runtime objects<br />

that subclass our implementati<strong>on</strong> may use protected DOM<br />

fields inappropriately and violate the same-origin policy.<br />

We view this flexibility as both an asset and a liability:<br />

it permits researchers to experiment with alternatives to<br />

the SOP, or to prototype enhancements to HTML and<br />

the DOM. At the same time, we do not advocate these<br />

72 <strong>Web</strong>Apps ’11: <str<strong>on</strong>g>2nd</str<strong>on</strong>g> <str<strong>on</strong>g>USENIX</str<strong>on</strong>g> <str<strong>on</strong>g>C<strong>on</strong>ference</str<strong>on</strong>g> <strong>on</strong> <strong>Web</strong> Applicati<strong>on</strong> <strong>Development</strong> <str<strong>on</strong>g>USENIX</str<strong>on</strong>g> Associati<strong>on</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!