<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>31270</bug_id>
          
          <creation_ts>2009-11-09 12:54:45 -0800</creation_ts>
          <short_desc>Social Engineering Issue with &quot;javascript:&quot; URLs</short_desc>
          <delta_ts>2009-11-09 14:08:46 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc>http://www.facebook.com/group.php?gid=170096529644&amp;v=info</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nathan Hammond">bugs.webkit.org</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>bugs.webkit.org</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>161721</commentid>
    <comment_count>0</comment_count>
    <who name="Nathan Hammond">bugs.webkit.org</who>
    <bug_when>2009-11-09 12:54:45 -0800</bug_when>
    <thetext>This vulnerability is with regards to how easy it is to create a XSS + worm + phishing attack without necessarily triggering a non-technical user&apos;s security alarm. This could become a common attack vector at any point in time.

1. Create a Facebook group, &apos;Get $25 from $BANK&apos;. (This works for any social networking site.)
2. Provide simple, easy-to-follow directions that will walk the person through using a &quot;javascript:&quot; URL, causing the user to create their own XSS hole in the social networking web application.
3. Use your new access to help promote the group in a worm-style manner, in a TRUSTED ENVIRONMENT: &quot;Your friend Joe Smith has invited you to join the group, &apos;Get $25 from $BANK&apos;.&quot;

Non-malicious examples of 1-3 in the wild:
-&gt; http://www.facebook.com/group.php?gid=170096529644&amp;v=info
-&gt; javascript:var numfriends=document.getElementById(&apos;friends&apos;).getElementsByTagName(&apos;li&apos;).length;fs.click(document.getElementById(&apos;friends&apos;).getElementsByTagName(&apos;a&apos;)[1].parentNode);for(var i=0; i &lt; numfriends; i++){fs.click(document.getElementById(&apos;friends&apos;).getElementsByTagName(&apos;a&apos;)[i].parentNode);}

4. Add a script loader into the &quot;javascript:&quot; URL. Any will do.
-&gt; http://www.nczonline.net/blog/2009/07/28/the-best-way-to-load-external-javascript/

5. Use the script loader to load http://www.example.com/maliciousscript.js which mutates the DOM (blows everything away)--without making a page request--and turns it into a phishing site.

*** &lt;FIXABLE PROBLEM&gt; ***

6. Note that the URL still displays the &quot;javascript:&quot; URL. This effectively masks the site that the user is presently on (facebook.com, controlled by example.com/maliciousscript.js). With properly written instructions on the Facebook group the user will implicitly believe that they are on the actual $BANK site in spite of the &quot;javascript:&quot; URL being displayed in the location bar, *because they specifically pasted it there to create the action.*

*** &lt;/FIXABLE PROBLEM&gt; ***

7. Steal usernames and passwords from thousands of people. Profit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>161730</commentid>
    <comment_count>1</comment_count>
    <who name="Nathan Hammond">bugs.webkit.org</who>
    <bug_when>2009-11-09 13:06:03 -0800</bug_when>
    <thetext>I&apos;ve reported this issue to Mozilla as well, bug 527530.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>161770</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-11-09 13:48:03 -0800</bug_when>
    <thetext>Can you say concretely what change you&apos;d like us to make?

Also, can you CC abarth-mozilla@adambarth.com to the Mozilla bug so we can coordinate our response?  Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>161772</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-11-09 13:49:23 -0800</bug_when>
    <thetext>Nevermind, I see that Mozilla has made this issue public.  I&apos;m doing the same here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>161774</commentid>
    <comment_count>4</comment_count>
    <who name="Nathan Hammond">bugs.webkit.org</who>
    <bug_when>2009-11-09 13:53:36 -0800</bug_when>
    <thetext>The change I am suggesting:

Immediately after execution of a &quot;javascript:&quot; URL, return the location bar to its prior state.

This would prevent the phishing site from hiding behind the &quot;javascript:&quot; URL.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>161776</commentid>
    <comment_count>5</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2009-11-09 13:56:49 -0800</bug_when>
    <thetext>I&apos;m sorry, but that&apos;s not a bug in WebKit.  The embedder (Safari) controls whether to reset the location bar.  For example, Chrome uses WebKit and does reset the location bar.  You should file a bug here:

http://bugreport.apple.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>161777</commentid>
    <comment_count>6</comment_count>
    <who name="Nathan Hammond">bugs.webkit.org</who>
    <bug_when>2009-11-09 13:59:56 -0800</bug_when>
    <thetext>Okay, thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>161782</commentid>
    <comment_count>7</comment_count>
    <who name="Nathan Hammond">bugs.webkit.org</who>
    <bug_when>2009-11-09 14:08:46 -0800</bug_when>
    <thetext>&lt;rdar://problem/7378262&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>