SlideShare a Scribd company logo
PREVENTING XSS & CSRF
  Dave Ross • Suburban Chicago PHP & Web Development Meetup
2½ years ago
http://www.slideshare.net/csixty4/intro-to-php-security
REALITY CHECK
“More than half of identity theft
    cases are inside jobs”
  Judith Collins, Associate Criminal Justice Professor @ Michigan State University
                “who recently completed a study of 1,037 such cases”
THE WEB IS STILL
 A NASTY PLACE
BROWSER SECURITY IS
     BETTER
PHP IS BETTER
REGISTER_GLOBALS IS
DEPRECATED IN 5.3.0
THREATS:
XSS - CROSS SITE SCRIPTING
NON-PERSISTENT XSS
PARAMETERS ECHOED
 BACK TO THE USER
<IMG SRC=”HTTP://SEARCH.AMAZON.COM?S=
   <SCRIPT>ALERT(‘TEST’);</SCRIPT>” />
PERSISTENT XSS
INJECT <IFRAME> &
<SCRIPT> INTO CONTENT
BLOG COMMENTS,
  FORUM POSTS
STRIP OUT TAGS
I RECOMMEND REMOVING
TAGS ON DISPLAY, NOT SAVE
CSRF - CROSS-SITE REQUEST
         FORGERY
<IMG SRC=”HTTP://TWITTER.COM/POST?TEXT=I’M A BIG FAT DORK” />
USE A NONCE.
HTTP://HA.CKERS.ORG/XSS.HTML
HTTP://WWW.CGISECURITY.COM/CSRF-FAQ.HTML

More Related Content

PPTX
Navigating Online Threats - Website Security for Everyday Website Owners
PPT
TBEX - North America 2014 - 5 Tips to Keep Your Content and Users Safe
PDF
WordCamp Miami 2016 SiteLock Presentation
PPTX
Word camp orange county 2012 enduser security
PDF
Understanding CSRF
PPTX
Content Management System Security
PDF
Esoteric xss payloads
Navigating Online Threats - Website Security for Everyday Website Owners
TBEX - North America 2014 - 5 Tips to Keep Your Content and Users Safe
WordCamp Miami 2016 SiteLock Presentation
Word camp orange county 2012 enduser security
Understanding CSRF
Content Management System Security
Esoteric xss payloads

What's hot (20)

PDF
Bug Bounty - Hackers Job
DOCX
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
PPTX
Introduction to CSRF Attacks & Defense
PDF
Nir goldshlager Killing a bug bounty program - twice Hack In The Box 2012
PPTX
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
PDF
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
PDF
The most Common Website Security Threats
PDF
ACRNA Webinar #5: Cyber Security – The Unlikely Romance
PDF
Attacking Web Proxies
PDF
Writing vuln reports that maximize payouts - Nullcon 2016
PPTX
Open Source CMS : How secure are they?
PPT
Xss.e xopresentation from eXo SEA
PPTX
Cross site request forgery(csrf)
PPTX
Xss (cross site scripting)
PPT
HoneySpam 2.0 Profiling Web Spambot Behaviour
PPTX
Cross Site Scripting
PPTX
Steps to Keep Your Site Clean
PPTX
Security testing for web developers
PPTX
WordPress Security Begins With Good Posture
Bug Bounty - Hackers Job
CROSS-SITE REQUEST FORGERY - IN-DEPTH ANALYSIS 2011
Introduction to CSRF Attacks & Defense
Nir goldshlager Killing a bug bounty program - twice Hack In The Box 2012
BEST PRACTICES OF WEB APPLICATION SECURITY By SAMVEL GEVORGYAN
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
The most Common Website Security Threats
ACRNA Webinar #5: Cyber Security – The Unlikely Romance
Attacking Web Proxies
Writing vuln reports that maximize payouts - Nullcon 2016
Open Source CMS : How secure are they?
Xss.e xopresentation from eXo SEA
Cross site request forgery(csrf)
Xss (cross site scripting)
HoneySpam 2.0 Profiling Web Spambot Behaviour
Cross Site Scripting
Steps to Keep Your Site Clean
Security testing for web developers
WordPress Security Begins With Good Posture
Ad

Viewers also liked (19)

KEY
Advanced CSRF and Stateless Anti-CSRF
PPTX
CSRF Attack and Its Prevention technique in ASP.NET MVC
PDF
Oh no, was that CSRF #Ouch
PPT
CSRF_RSA_2008_Jeremiah_Grossman
PPTX
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
PDF
Protect you site from CSRF
KEY
Stateless Anti-Csrf
PDF
Web security: OWASP project, CSRF threat and solutions
ODP
Drupal Security for Coders and Themers - XSS and CSRF
PDF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRF
PDF
PPTX
A8 cross site request forgery (csrf) it 6873 presentation
PPTX
OWASP Ireland June Chapter Meeting - Paul Mooney on ARMOR & CSRF
PDF
CSRF, ClickJacking & Open Redirect
PPTX
Understanding Cross-site Request Forgery
PPTX
Browser Security 101
PPT
XSS and CSRF with HTML5
Advanced CSRF and Stateless Anti-CSRF
CSRF Attack and Its Prevention technique in ASP.NET MVC
Oh no, was that CSRF #Ouch
CSRF_RSA_2008_Jeremiah_Grossman
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Protect you site from CSRF
Stateless Anti-Csrf
Web security: OWASP project, CSRF threat and solutions
Drupal Security for Coders and Themers - XSS and CSRF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRF
A8 cross site request forgery (csrf) it 6873 presentation
OWASP Ireland June Chapter Meeting - Paul Mooney on ARMOR & CSRF
CSRF, ClickJacking & Open Redirect
Understanding Cross-site Request Forgery
Browser Security 101
XSS and CSRF with HTML5
Ad

Similar to Web App Security: XSS and CSRF (20)

PPTX
Pci compliance writing secure code
PDF
Session7-XSS & CSRF
PDF
Lets Make our Web Applications Secure
PDF
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
PDF
Evolution Of Web Security
PPTX
CS166 Final project
PPT
PHPUG Presentation
PPTX
Vulnerabilities in Web Applications
PDF
Secure Form Processing and Protection - Sunshine PHP 2015
PPT
[Php Camp]Owasp Php Top5+Csrf
PDF
Web Security Horror Stories
PDF
Security in PHP Applications: An absolute must!
PDF
null Bangalore meet - Php Security
PDF
Web vulnerabilities
PPT
DEFCON 17 Presentation: CSRF - Yeah, It Still Works
PPTX
Owasp & php
PPTX
Deep understanding on Cross-Site Scripting and SQL Injection
ODP
Security In PHP Applications
Pci compliance writing secure code
Session7-XSS & CSRF
Lets Make our Web Applications Secure
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
Evolution Of Web Security
CS166 Final project
PHPUG Presentation
Vulnerabilities in Web Applications
Secure Form Processing and Protection - Sunshine PHP 2015
[Php Camp]Owasp Php Top5+Csrf
Web Security Horror Stories
Security in PHP Applications: An absolute must!
null Bangalore meet - Php Security
Web vulnerabilities
DEFCON 17 Presentation: CSRF - Yeah, It Still Works
Owasp & php
Deep understanding on Cross-Site Scripting and SQL Injection
Security In PHP Applications

More from Dave Ross (20)

KEY
Stylesheets of the future with Sass and Compass
KEY
HTML5 History & Features
PPT
A geek's guide to getting hired
KEY
NoSQL & MongoDB
PDF
Date and Time programming in PHP & Javascript
KEY
Simulated Eye Tracking with Attention Wizard
KEY
What's new in HTML5?
KEY
The Canvas Tag
KEY
Wordpress
PPT
Lamp Stack Optimization
PPT
The FPDF Library
PPT
FirePHP
PPT
Bayesian Inference using b8
PPT
SQL Injection in PHP
KEY
The Mobile Web: A developer's perspective
KEY
Balsamiq Mockups
KEY
LAMP Optimization
KEY
Lint - PHP & Javascript Code Checking
KEY
Cufon - Javascript Font Replacement
KEY
PHP Output Buffering
Stylesheets of the future with Sass and Compass
HTML5 History & Features
A geek's guide to getting hired
NoSQL & MongoDB
Date and Time programming in PHP & Javascript
Simulated Eye Tracking with Attention Wizard
What's new in HTML5?
The Canvas Tag
Wordpress
Lamp Stack Optimization
The FPDF Library
FirePHP
Bayesian Inference using b8
SQL Injection in PHP
The Mobile Web: A developer's perspective
Balsamiq Mockups
LAMP Optimization
Lint - PHP & Javascript Code Checking
Cufon - Javascript Font Replacement
PHP Output Buffering

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Machine learning based COVID-19 study performance prediction
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation theory and applications.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The Rise and Fall of 3GPP – Time for a Sabbatical?
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation_ Review paper, used for researhc scholars
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Machine learning based COVID-19 study performance prediction
Building Integrated photovoltaic BIPV_UPV.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
20250228 LYD VKU AI Blended-Learning.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Electronic commerce courselecture one. Pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Understanding_Digital_Forensics_Presentation.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Programs and apps: productivity, graphics, security and other tools
Spectroscopy.pptx food analysis technology
Encapsulation theory and applications.pdf

Web App Security: XSS and CSRF