Update: You may also want to look at: 업데이트 :를 보면서 이런 생각을 할 수도있습니다 : 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 dot 라]를 출시 웜 [ "samy 웜"또는 "js.spacehero 웜"]를 myspace 인기있는 소셜 네트워킹 플랫폼 friendster처럼, 그에게 어떤 원인으로 추가가 myspace 영웅이 수백만의 사용자 ( "그러나 대부분의 의 모든 samy는 나의 영웅합니다. ")뿐만 아니라 그들의 친구로 그를 추가, 모두 명시적인 권한없이도 살아남을 수있다.

After flooding the Network, MySpace stepped in and fixed the hole. 홍수 이후의 네트워크 마이 스페이스 밟은 및 고정 구멍을합니다. 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 또는 linkedin 등 유사합니다. 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. 이 문서의 나머지 부분에서 나는 - operandi의 형태로 요약하기는 스크립트 및 웹 응용 프로그램을 보호하는 방법을 제안에서 이러한 공격을 반대합니다.

Samy used AJAX to add himself as a friend and hero when users visited his page. 자신을 친구로 사용 samy ajax를 추가하고 그 페이지를 방문한 사용자의 영웅합니다. This requires Javascript to be executed in the browser which does the dirty work. 이렇게하려면 브라우저에서 자바 스크립트를 실행하는 것이 더러운 일을합니다.

MySpace dutifully eliminates javascript from users html (which becomes their profile). 자바 스크립트에서 사용자의 충실을 제거 myspace html (이것은 자신의 프로필). However Sammy disguised the word javascript with an embedded newline - “java\nscript”. 그러나 1966 년 새미 자바 스크립트라는 단어가 포함된 개행 - "자바 \ nscript"합니다.

MySpace doesn’t allow script tags. myspace 스크립트 태그를 허용하지 않습니다. So he embedded his javascript in CSS - style=”background:url(’javascript:eval(document.all.mycode.expr)’)” 그래서 그는 그의 자바 스크립트를 내장 전투 근무 지원 - 스타일 = "배경 : url ( '자바 스크립트 : 평가 (document.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. 이후에 악용이 필터 / myspace 의해 중지합니다.

How can you protect your web application from such attacks? 귀하의 웹 응용 프로그램을 어떻게 이러한 공격을 보호할 수 있습니까?
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. 우선 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. 다른 사용자의 프로필을 (또는 콘텐츠)는 별도의 서브 - 도메인에서만 볼 수있습니다.

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. 이 페이지에 어떤 콘텐츠를 포함해서는 안에서 사용자 추가되고있습니다.

In essence we need to captalize on AJAX security model which prevents code execution from different site. 본질적 captalize해야 ajax 보안 모델을 다른 사이트에서 코드가 실행을 방지합니다.