Update: You may also want to look at:更新日: 2007を見ていただくこともできます: MySpace Hack: How To View Any Users Private Videos MySpaceの刻み目:任意のユーザーのプライベートビデオを表示する方法 .です。

Recently最近 Samy samy [samy at namb dot la] released a worm ["Samy worm" or "JS.Spacehero worm"] in MySpace, popular social networking platform like Friendster, which caused him to be added as hero to millions of MySpace users (”but most of all, samy is my hero.”) as well as add him as their friend, all without their explicit permission. [ samyでnambドットラ]をリリースワーム[ " samyワーム"または" js.spaceheroワーム" ] 、 myspaceのは、フレンドスターのような人気のソーシャルネットワーキングプラットフォームを引き起こした彼を英雄として追加されるのmyspaceに何百万ものユーザー( "しかし、ほとんどののすべての、 samyは私の英雄です。 " )だけでなく彼らの友人として彼に追加する、すべての明示的な許可なしにします。

After flooding the Network, MySpace stepped in and fixed the hole.冠水した後、ネットワーク、 MySpaceの強化し、固定の穴です。 Samy is still “hero” to millions of MySpace users in their profile. samyはまだ"英雄"を数百万のMySpaceのユーザーに、自分のプロファイルです。

The purpose of this article is to highlight the security issues exposed by this worm.その目的は、次の資料が公開さを浮き彫りにするこのワームの安全保障問題です。 It is definitely not limited to MySpace alone and the worm propagated not due to MySpace’s fault but fault of browser like Internet Explorer. myspaceのないことは間違いないだけに限定さやワームの伝播のために特定のブラウザのmyspaceの断層が断層のようなインターネットエクスプローラを起動します。 And the flaw is waiting to be exploited in several other web applications of similar nature like Ryze or LinkedIn etc..との欠陥が悪用されるのを待って、他のウェブアプリケーションのいくつかのように同じような自然やリンクトインryze等です。 In the remainder of this article I will summarize the modus-operandi of his script and suggest on ways to protect your web application against such attacks.この記事での残りの部分を要約する手口-においては私は彼のスクリプトとする方法を提案してWebアプリケーションを保護するような攻撃反対です。

Samy used AJAX to add himself as a friend and hero when users visited his page. ajaxを追加するsamy使用される自身のことを友人に送るとヒーローを訪れたとき、彼のページをご覧ください。 This requires Javascript to be executed in the browser which does the dirty work.このため、 JavaScriptをブラウザで実行されるのは、汚い仕事です。

MySpace dutifully eliminates javascript from users html (which becomes their profile). JavaScriptを律義にmyspaceのユーザからの排除のHTML (これが、自分のプロファイル) 。 However Sammy disguised the word javascript with an embedded newline - “java\nscript”.しかしサミー偽装という言葉が埋め込まれたJavaScriptの改行-" J avaの\ n script"です。

MySpace doesn’t allow script tags. myspaceのscriptタグは許可されません。 So he embedded his javascript in CSS - style=”background:url(’javascript:eval(document.all.mycode.expr)’)”彼のJavaScriptを埋め込まれたので、彼のCSS -スタイル= "背景: U RLを( 'のJ avaScript: e val( d ocument.all.mycode.expr) ' ) "

AJAX can fetch documents from the same domain (or sub-domain) only. ajaxドキュメントを取得することと同じドメイン(またはサブドメイン)のみです。 So if the user was on profile.myspace.com, he moved them to www.myspace.com which provides the same information but allows him to be added as a friend. profile.myspace.comている場合、ユーザは、彼に移動してしても同じ情報を提供するwww.myspace.comしかしにより、彼を友達として追加されました。
if (location.hostname == 'profile.myspace.com') document.location = 'http://www.myspace.com' + location.pathname + location.search; もし( location.hostname == ' profile.myspace.com ' ) document.location = ' http://www.myspace.com ' + location.pathname + location.search ;

After overcoming a trvial hash issue he adds his code and “but most of all, samy is my hero.” text to users profile. trvialハッシュの問題を克服した後、彼は彼のコードを追加し"しかし、ほとんどのすべての、 samyは私の英雄です。 "のテキストをユーザープロファイルです。 This causes the worm to propagate not only when users visit his site but also when they visit any of the infected users.これが原因で、ワームを広めるだけでなく、ユーザーが閲覧したときだけでなく、彼のサイトにアクセスした場合、感染したユーザーのいずれかのです。 Yes, simple exponential spreading.はい、単純な指数広がっている。

Samy provides samy提供 detailed notes and code for his exploit詳細なノートとのコードを自分の悪用 after the exploit was filtered / stopped by MySpace.悪用の後には、フィルタリング/停止させた。

How can you protect your web application from such attacks? あなたはどうすればこのような攻撃から保護してWebアプリケーションですか?
First and foremost I assume you have filtering in place like MySpace did filtering scripts and javascript tags etc. However obviously that is not enough; not even close.まず第一と仮定してフィルタリングの代わりに私のようなスクリプトとJavaScriptタグのmyspaceのフィルタリングなどは明らかにされていないしかし十分な;も終了します。
Your filtering tags should be intelligent to recognize words separated by newlines as shown above.インテリジェントフィルタリングしてタグを認識する必要が区切られて改行の言葉として上の図を参照します。

Other users profile (or any html content) should be viewable only from a separate sub-domain.他のユーザープロファイル(または任意のHTMLコンテンツ) のみ閲覧すべきであるから、別のサブドメインです。

Any actions like adding a link, friend, connection etc. must be done from pages which can never contains any other users code.リンクを追加するようないかなる行動について、友達、接続等がなされなければならないことはどのページから他のユーザーに任意のコードが含まれています。 If you provide a link while viewing others profile to add his as a friend then on clicking you take him to a separate page where the users gets to edit information about his friend and add him after confirmation.リンクを提供する場合に他のプロファイルを見ながら彼を友達として追加をクリックしてから彼をクリックして、別のページで、ユーザーの取得に関する情報を編集する彼彼の友人に送ると確認した後に追加します。 This page should not contain any html content from the user being added.このページはないが含まれ、ユーザからの任意のHTMLコンテンツに追加します。

In essence we need to captalize on AJAX security model which prevents code execution from different site.本質的に私たちをする必要がcaptalize ajaxのセキュリティモデル別のサイトからのコードの実行を防止します。