<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Tom Moertel's Weblog: Google Web Accelerator offers web developers an important opportunity</title>
    <link>http://blog.moertel.com/articles/2005/05/06/google-web-accelerator-offers-web-developers-an-important-opportunity</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Quality rants on programming theory and stuff geeks like</description>
    <item>
      <title>Google Web Accelerator offers web developers an important opportunity</title>
      <description>&lt;p&gt;Google Web Accelerator offers web developers an important opportunity
There has been a lot of heat lately about &lt;a href="http://webaccelerator.google.com/"&gt;Google&amp;#8217;s Web Accelerator&lt;/a&gt; (GWA)
&lt;a href="http://www.37signals.com/svn/archives2/google_web_accelerator_hey_not_so_fast_an_alert_for_web_app_designers.php"&gt;exposing serious problems&lt;/a&gt; in some popular web
applications. The problem, in short, is that these applications use
&lt;span class="caps"&gt;GET&lt;/span&gt;-based links that when followed perform dangerous actions such as
deleting records in a database. According to web standards going back
a decade, that is a no-no: Links should be safe to follow. Thus &lt;span class="caps"&gt;GWA&lt;/span&gt;,
expecting links to be safe, tries to help you out by pre-fetching
various resources that are linked to by the pages you
visit. Unfortunately, if the page you happen to be visiting contains
lots of dangerous links, &lt;span class="caps"&gt;GWA&lt;/span&gt; will innocently try to pre-fetch the
&amp;#8220;resources&amp;#8221; that the links point to, and in doing so will accidentally
delete a bunch of stuff. Oops.&lt;/p&gt;


	&lt;p&gt;That&amp;#8217;s the backdrop for our real story, which is the response from the
community of web developers. What I find fascinating, and somewhat
disheartening, is the number of people who say the problem is Google&amp;#8217;s
to fix. Yes, there are a lot of broken web apps out there, and Google
could have been smarter about working around the minefields those apps
represent. But that&amp;#8217;s a side problem. The real problem is that there
are a lot of broken web apps out there, and they &lt;em&gt;do&lt;/em&gt; represent
minefields. Worse, a lot of web developers think it is acceptable to
brush aside fundamental conventions of the web going back a &lt;em&gt;decade&lt;/em&gt;
when they find it sexier to use &lt;span class="caps"&gt;GET&lt;/span&gt; instead of &lt;span class="caps"&gt;POST&lt;/span&gt;.&lt;/p&gt;


	&lt;p&gt;What these developers overlook is that the web is not a bunch of
colorful pages with buttons, clickable links, and pretty
pictures. Rather the web is a distributed collection of hypertext
documents, each of which has a meaning that is given by standards that
most people have agreed to follow. While the collection may &lt;em&gt;look&lt;/em&gt; like
a bunch of colorful pages &lt;em&gt;in one particular visual presentation&lt;/em&gt;, it
really, truly is not.&lt;/p&gt;


	&lt;p&gt;Nevertheless, many web applications are designed with the prevailing
mindset that the meaning of the web is nothing more than how it looks
and behaves in a web browser. Even if those web applications are not
intended for use outside of a few approved browsers &amp;#8211; the escape
hatch that is often used to justify departures from the
standards &amp;#8211; this mindset is wrong.&lt;/p&gt;


	&lt;p&gt;The reason it is wrong is because, like it or not, web applications
are implemented in terms of protocols and languages that &lt;em&gt;mean
something&lt;/em&gt;. The bits and pieces of a web application each &lt;em&gt;mean
something&lt;/em&gt;, even if what they mean is not in harmony with the
designer&amp;#8217;s overall vision. What a web designer may see as a bold, red
link that says &amp;#8220;delete&amp;#8221; and is protected by a Javascript confirmation
dialog, is actually a hypertext reference &amp;#8211; a pointer
to another resource that the standards say should not be dangerous to
follow. Thus there is a fundamental mismatch between what the designer
is trying to say &amp;#8211; &amp;#8220;follow this link only if you
really, no-kidding want to delete something&amp;#8221; &amp;#8211; and
what his markup actually &lt;em&gt;means&lt;/em&gt;: &amp;#8220;this link is safe to follow.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;The bottom line is that hypertext links are supposed to be
safe. Dangerous links can&amp;#8217;t be made &amp;#8220;safe&amp;#8221; by layering tricks on
them. Wrapping them with Javascript confirmation dialogs doesn&amp;#8217;t make
them safe. This trick fails fundamentally because the meaning of a
link doesn&amp;#8217;t change when there is Javascript associated with it. It
fails practically because not all consumers of hypertext evaluate
Javascript, nor do any standards suggest that they should. (This is
also why client-side validation cannot be trusted on the server side.)&lt;/p&gt;


	&lt;p&gt;Hiding dangerous links in authorization-controlled portions of a web
application does not make them safe, either. This trick might shield
the links from external spiders, but the standards allow for any
number of intermediary agents (such as Google&amp;#8217;s Web Accelerator) to
work &lt;em&gt;on behalf of an authorized user.&lt;/em&gt; Anything the user is authorized
to do, so are the user&amp;#8217;s agents. If the user can click the &amp;#8220;delete&amp;#8221; 
link, so can the agents.&lt;/p&gt;


	&lt;h4&gt;Let&amp;#8217;s answer the wake-up call.&lt;/h4&gt;


	&lt;p&gt;&lt;span class="caps"&gt;GWA&lt;/span&gt; is only the first of a new breed of
smarter user agents that promise to make the web a better place for
all of us. If you&amp;#8217;re a web developer, take the slew of problems that
&lt;span class="caps"&gt;GWA&lt;/span&gt; uncovered as a wake-up call. Even if Google works around your
problems, other user agents may not. As developers, it&amp;#8217;s time to admit
our mistakes and fix the stupid things that our web applications do.&lt;/p&gt;


	&lt;p&gt;First, let&amp;#8217;s drive a stake in the notion that dangerous links are OK
if we&amp;#8217;re &amp;#8220;careful.&amp;#8221; They&amp;#8217;re not. Dangerous links are
lazy. &amp;#8220;Confirming&amp;#8221; them with Javascript or &amp;#8220;hiding&amp;#8221; them behind
authorization doesn&amp;#8217;t work.&lt;/p&gt;


	&lt;p&gt;Second, let&amp;#8217;s clean house. Let&amp;#8217;s find those places where we have laced
our web applications with dangerous links and remove them. Break out
the forms! Long live the &lt;span class="caps"&gt;POST&lt;/span&gt;!&lt;/p&gt;


	&lt;p&gt;Third, let&amp;#8217;s take a look at how we got into this mess and try to learn
from our mistakes. Do we value sexiness more than substance? We like
to think that form follows function and that good design and good
implementation go hand in hand, but the reality of this debacle
suggests otherwise. I think the truth is that on the web, sexiness and
hype are what gets attention, and we seek attention more than we like
to admit.&lt;/p&gt;


	&lt;p&gt;Maybe the best thing for us is a good dose of humility. And, come to
think of it, that&amp;#8217;s just what Google&amp;#8217;s Web Accelerator offered us.&lt;/p&gt;</description>
      <pubDate>Fri, 06 May 2005 21:55:00 -0400</pubDate>
      <guid isPermaLink="false">urn:uuid:e542d7e0-94c6-4a4e-a41e-2b7ea7de7494</guid>
      <author>Tom Moertel</author>
      <link>http://blog.moertel.com/articles/2005/05/06/google-web-accelerator-offers-web-developers-an-important-opportunity</link>
      <category>web development</category>
      <category>rails</category>
      <category>get</category>
      <category>gwa</category>
      <category>safe</category>
      <category>unsafe</category>
      <category>post</category>
      <trackback:ping>http://blog.moertel.com/articles/trackback/210</trackback:ping>
    </item>
  </channel>
</rss>
