SlideShare a Scribd company logo
XSS (Cross-Site Scripting) - An
application security vulnerability from
Developers point of view
Soumyasanto Sen, #sitMUC
@soumyasanto
Wikipedia says
"XSS enables attackers to inject client-side script into web pages viewed by other users".
OWASP(the free and open software security community) says
"Cross-Site Scripting attacks are a type of injection problem, in which malicious scripts are injected
into the otherwise benign and trusted web sites."
"An XSS attack occurs when a script from an untrusted source is executed in
rendering a page"
#sitMUC
Definition
#sitMUC
What is XSS?
 Client side vulnerability but can Server side one.
 Based on injection through
JavaScript, VBScript, Flash, HTML, JSON, ActiveX etc.
 Due to insufficient validation and sanitization.
 Attacker’s Paradise
 Stealing Credentials, Private Info.
 Execute commands (CSRF), malicious scripts
 Redirection to malicious site
 Port Scanning, Phishing, Keylogging etc.
#sitMUC
What is XSS?
#sitMUC
 According to latest White-hat Security report, 47% of web applications have XSS vulnerability
Why XSS?
#sitMUC
 According to Google Vulnerability Reward Program's Statistics, XSS is the most
reported issue
Why XSS?
#sitMUC
 According to "Open Sourced Vulnerability Database" XSS is at #1
Why XSS?
#sitMUC
 TrustWave Global Security Report says XSS is again the highest
Why XSS?
#sitMUC
 No Monkey Testing
Example: Based on Testing
Injection Points: Through which the Attacker can enter or injects scripts
 Insert /Edit Text
 Insert/Edit Image
 Insert/Edit URL
 Set Attributes
 Insert/Upload File
 Insert/Upload Video
What is Context? Context is an environment where user-supplied input or input from other
application(s) eventually ends-up or starts living.
“Context Is King for All Areas of IT Security”
#sitMUC
Example: Based on Testing
(Definitions)
#sitMUC
http://www.ea.com/search?q=“XYZ
Example: Based on Testing
(Contexts)
#sitMUC
http://www.ea.com/search?q=“JUNK
Example: Based on Testing
(Contexts)
#sitMUC
http://search.health.com/results.html?Ntt=xxxxxxxxxx
Single Quotes Case
Double Quotes Case
Example: Based on Testing
(Contexts)
#sitMUC
https://www.froala.com/wysiwyg-editor
Example: Based on Testing
(Contexts)
#sitMUC
Example: Based on Testing
(Contexts)
#sitMUC
Example: Based on Testing
(Summary of Contexts)
#sitMUC
ATTACK METHODOLOGY
• Systematic in nature
• Easy to understand
• Context-Specific
• Attack methodology is `complete` and one can guarantee that there is an XSS or no XSS in a
particular injection point.
• With the help of attack methodology, one can make a secure per-context XSS sanitizer
• Can be applied to other server-side languages
Example: Based on Testing
(Attack Methodology)
#sitMUC
SCRIPT CONTEXT
ATTACK METHODOLOGY
Example: Based on Testing
(Attack Methodology)
Demo
http://jsfiddle.net/4eqK4/5/
#sitMUC
ATTRIBUTE CONTEXT
ATTACK METHODOLOGY
Example: Based on Testing
(Attack Methodology)
Demo
http://www.drudgereportarc
hives.com/dsp/search.htm
http://jsfiddle.net/9t8UM/3/
#sitMUC
STYLE CONTEXT
ATTACK METHODOLOGY
Example: Based on Testing
(Attack Methodology)
#sitMUC
URL CONTEXT
ATTACK METHODOLOGY
Example: Based on Testing
(Attack Methodology)
#sitMUC
 <a href="url">link text</a>
 <a href=javascript:alert(1)>link text</a>

 <img src="pic_mountain.jpg">
 <img src=javascript:while(1){}>
Example: Based on Testing
(Attack Methodology)
#sitMUC
Encoding will not help
in breaking the script
context unless
developers are doing
some sort of explicit
decoding.
Example: Based on Testing
(Attack Methodology)
#sitMUC
Two arrays of black-listed keywords
Other names filterXSS and noXSS
Example: Based on Testing
(Customized XSS Solutions)
#sitMUC
Two arrays of black-listed keywords
Example: Based on Testing
(Customized XSS Solutions)
Bypass: <img src=x id=confirm(1) onerror=eval(id)
#sitMUC
The goal of this function is to stop
JavaScript execution via style.
Example: Based on Testing
(Customized XSS Solutions)
Bypass:
width:expression&#x28;al
ert&#x28;1&#x29;&#x29;
#sitMUC
Example: Based on Testing
(Customized XSS Solutions)
Another popular customized XSS protection solution
#sitMUC
Example: Based on Testing
(Summary of Bypasses)
#sitMUC
Example: Based on Testing
(Real Solutions)
#sitMUC
Example: Based on Testing
(Real Solutions)
Protection against JavaScript execution via `url` e.g., img'ssrc and/or anchor's
href attribute Implementation of `urlContextCleaner()`
#sitMUC
Example: Based on Testing
(Solutions -Make it Simple)
WYSIWYG
What You See Is What You Get
· Forum Post
· Private Messaging
· Wiki Post
· Support Ticket
· Signature Creation
· Comments
#sitMUC
Example: Based on Testing
(Solutions -Make it Simple)
WYSIWYG
What You See Is What You Get
#sitMUC
Example : Based on Real
(Bypassing)
 ABAP Case Study:
#sitMUC
Demo: Based on Games
(Bypassing)
https://xss-game.appspot.com/
http://xssplaygroundforfunandlearn.netai.net/series1.html
https://html5sec.org/innerhtml/ (Mario Heiderich's Utility)
#sitMUC
Tools & Testing
 XSS (Cross Site Scripting) Prevention Cheat Sheet from OWASP
 (HTML5 Security Clean Sheet)
 Validation on XSS Input. Use White-Listing, Escaping and sanitization method.
(Use Sanitizers)
“Do not trust anything ever, specially when it comes to user input”
 Understanding common browser behaviors that lead to XSS
 Learning the best practices for your technology
#sitMUC
Preventions
#sitMUC
Latest News
Salesforce plugs silly website XSS hole, hopes nobody spotted it (Mid August)
Critical PayPal XSS vulnerability left accounts open to attack (Late August)
eBay Fixes XSS Flaw in Subdomain (Early September)
Netflix Sleepy Puppy Awakens XSS Vulnerabilities in Secondary Applications (Early
September)
Attackers exploit vulnerabilities in two WordPress plugins (Early May)
#sitMUC
Latest News
0-day XSS vulnerability on SAP website put customers’ data at risk of theft by
hackers (Early May)
SAP HANA Databases Vulnerable to XSS and SQL Injections (Late June)
Overall:
Almost ALL websites have serious security vulnerabilities, study
shows
 Lack enough Pen. Test
( 92% of the respondents perform penetration testing. 21% perform it annually, 26%
perform it quarterly and 8% never perform penetration testing.)
 Taking responsibility from the Developers
 Unawareness of XSS vulnerability
 Not taking seriously
#sitMUC
Challenges
XSS is unavoidable at least nowadays !
Now its your job to raise the bar for attacker.
“XSS is Everywhere”
(Short and Simple)
Use Prevention, Go for Solutions in the forms of layers, Keep Updated
& Do regular Penetration Testing
#sitMUC
Conclusion
#sitMUC
Learning
Thank You
Soumyasanto Sen
@soumyasantoDr. Ashar Javed : http://slides.com/mscasharjaved/

More Related Content

PPTX
Cross Site Scripting ( XSS)
PPTX
Cross Site Scripting Defense Presentation
PDF
Cross site scripting attacks and defenses
PDF
Cross Site Scripting Going Beyond the Alert Box
PPTX
Reflective and Stored XSS- Cross Site Scripting
PPTX
Cross site scripting
PPT
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Cross Site Scripting ( XSS)
Cross Site Scripting Defense Presentation
Cross site scripting attacks and defenses
Cross Site Scripting Going Beyond the Alert Box
Reflective and Stored XSS- Cross Site Scripting
Cross site scripting
Top 10 Web Security Vulnerabilities (OWASP Top 10)

What's hot (20)

PPTX
Cross Site Scripting
PPTX
Cross Site Scripting: Prevention and Detection(XSS)
PPTX
Cross Site Scripting(XSS)
PPTX
PDF
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
PPTX
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
PDF
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
PPT
Cross site scripting (xss)
PDF
OWASP Top 10 Web Application Vulnerabilities
PDF
Bug Bounty - Hackers Job
PDF
Building Advanced XSS Vectors
PDF
Cross site scripting
PPT
XSS - Attacks & Defense
PPTX
Owasp top 10 vulnerabilities
PPTX
Deep understanding on Cross-Site Scripting and SQL Injection
PPTX
Introduction XSS
PPT
Source Code Analysis with SAST
PDF
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
PPT
SQL Injection
PPTX
Cross Site Scripting (XSS)
Cross Site Scripting
Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting(XSS)
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss)
OWASP Top 10 Web Application Vulnerabilities
Bug Bounty - Hackers Job
Building Advanced XSS Vectors
Cross site scripting
XSS - Attacks & Defense
Owasp top 10 vulnerabilities
Deep understanding on Cross-Site Scripting and SQL Injection
Introduction XSS
Source Code Analysis with SAST
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
SQL Injection
Cross Site Scripting (XSS)
Ad

Similar to XSS- an application security vulnerability (20)

PPTX
Convincing Developers to take Cross-Site Scripting Seriously
PPTX
Cross-Site Scripting (XSS)
KEY
Cross Site Scripting - Mozilla Security Learning Center
PPTX
Cross Site Scripting (XSS)
PPTX
Client sidesec 2013 - script injection
PPTX
Security testing for web developers
PDF
XSS.pdf
PDF
XSS.pdf
PPTX
XSS: From alert(1) to crypto mining malware
DOCX
logout.php Session Data after Logout Username Email . $_.docx
PPT
4.Xss
PPT
Xss talk, attack and defense
PDF
Introduction to Cross Site Scripting ( XSS )
PPTX
Cross site scripting
PPTX
Cm7 secure code_training_1day_xss
PDF
IBWAS 2010: Web Security From an Auditor's Standpoint
PDF
Luis Grangeia IBWAS
PPT
XSS Primer - Noob to Pro in 1 hour
PPTX
Cross site scripting XSS
Convincing Developers to take Cross-Site Scripting Seriously
Cross-Site Scripting (XSS)
Cross Site Scripting - Mozilla Security Learning Center
Cross Site Scripting (XSS)
Client sidesec 2013 - script injection
Security testing for web developers
XSS.pdf
XSS.pdf
XSS: From alert(1) to crypto mining malware
logout.php Session Data after Logout Username Email . $_.docx
4.Xss
Xss talk, attack and defense
Introduction to Cross Site Scripting ( XSS )
Cross site scripting
Cm7 secure code_training_1day_xss
IBWAS 2010: Web Security From an Auditor's Standpoint
Luis Grangeia IBWAS
XSS Primer - Noob to Pro in 1 hour
Cross site scripting XSS
Ad

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Cloud computing and distributed systems.
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Spectroscopy.pptx food analysis technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation theory and applications.pdf
Empathic Computing: Creating Shared Understanding
Building Integrated photovoltaic BIPV_UPV.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
Cloud computing and distributed systems.
Diabetes mellitus diagnosis method based random forest with bat algorithm
Understanding_Digital_Forensics_Presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectroscopy.pptx food analysis technology
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25 Week I
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx

XSS- an application security vulnerability

  • 1. XSS (Cross-Site Scripting) - An application security vulnerability from Developers point of view Soumyasanto Sen, #sitMUC @soumyasanto
  • 2. Wikipedia says "XSS enables attackers to inject client-side script into web pages viewed by other users". OWASP(the free and open software security community) says "Cross-Site Scripting attacks are a type of injection problem, in which malicious scripts are injected into the otherwise benign and trusted web sites." "An XSS attack occurs when a script from an untrusted source is executed in rendering a page" #sitMUC Definition
  • 3. #sitMUC What is XSS?  Client side vulnerability but can Server side one.  Based on injection through JavaScript, VBScript, Flash, HTML, JSON, ActiveX etc.  Due to insufficient validation and sanitization.  Attacker’s Paradise  Stealing Credentials, Private Info.  Execute commands (CSRF), malicious scripts  Redirection to malicious site  Port Scanning, Phishing, Keylogging etc.
  • 5. #sitMUC  According to latest White-hat Security report, 47% of web applications have XSS vulnerability Why XSS?
  • 6. #sitMUC  According to Google Vulnerability Reward Program's Statistics, XSS is the most reported issue Why XSS?
  • 7. #sitMUC  According to "Open Sourced Vulnerability Database" XSS is at #1 Why XSS?
  • 8. #sitMUC  TrustWave Global Security Report says XSS is again the highest Why XSS?
  • 9. #sitMUC  No Monkey Testing Example: Based on Testing
  • 10. Injection Points: Through which the Attacker can enter or injects scripts  Insert /Edit Text  Insert/Edit Image  Insert/Edit URL  Set Attributes  Insert/Upload File  Insert/Upload Video What is Context? Context is an environment where user-supplied input or input from other application(s) eventually ends-up or starts living. “Context Is King for All Areas of IT Security” #sitMUC Example: Based on Testing (Definitions)
  • 15. #sitMUC Example: Based on Testing (Contexts)
  • 16. #sitMUC Example: Based on Testing (Summary of Contexts)
  • 17. #sitMUC ATTACK METHODOLOGY • Systematic in nature • Easy to understand • Context-Specific • Attack methodology is `complete` and one can guarantee that there is an XSS or no XSS in a particular injection point. • With the help of attack methodology, one can make a secure per-context XSS sanitizer • Can be applied to other server-side languages Example: Based on Testing (Attack Methodology)
  • 18. #sitMUC SCRIPT CONTEXT ATTACK METHODOLOGY Example: Based on Testing (Attack Methodology) Demo http://jsfiddle.net/4eqK4/5/
  • 19. #sitMUC ATTRIBUTE CONTEXT ATTACK METHODOLOGY Example: Based on Testing (Attack Methodology) Demo http://www.drudgereportarc hives.com/dsp/search.htm http://jsfiddle.net/9t8UM/3/
  • 20. #sitMUC STYLE CONTEXT ATTACK METHODOLOGY Example: Based on Testing (Attack Methodology)
  • 21. #sitMUC URL CONTEXT ATTACK METHODOLOGY Example: Based on Testing (Attack Methodology)
  • 22. #sitMUC  <a href="url">link text</a>  <a href=javascript:alert(1)>link text</a>   <img src="pic_mountain.jpg">  <img src=javascript:while(1){}> Example: Based on Testing (Attack Methodology)
  • 23. #sitMUC Encoding will not help in breaking the script context unless developers are doing some sort of explicit decoding. Example: Based on Testing (Attack Methodology)
  • 24. #sitMUC Two arrays of black-listed keywords Other names filterXSS and noXSS Example: Based on Testing (Customized XSS Solutions)
  • 25. #sitMUC Two arrays of black-listed keywords Example: Based on Testing (Customized XSS Solutions) Bypass: <img src=x id=confirm(1) onerror=eval(id)
  • 26. #sitMUC The goal of this function is to stop JavaScript execution via style. Example: Based on Testing (Customized XSS Solutions) Bypass: width:expression&#x28;al ert&#x28;1&#x29;&#x29;
  • 27. #sitMUC Example: Based on Testing (Customized XSS Solutions) Another popular customized XSS protection solution
  • 28. #sitMUC Example: Based on Testing (Summary of Bypasses)
  • 29. #sitMUC Example: Based on Testing (Real Solutions)
  • 30. #sitMUC Example: Based on Testing (Real Solutions) Protection against JavaScript execution via `url` e.g., img'ssrc and/or anchor's href attribute Implementation of `urlContextCleaner()`
  • 31. #sitMUC Example: Based on Testing (Solutions -Make it Simple) WYSIWYG What You See Is What You Get · Forum Post · Private Messaging · Wiki Post · Support Ticket · Signature Creation · Comments
  • 32. #sitMUC Example: Based on Testing (Solutions -Make it Simple) WYSIWYG What You See Is What You Get
  • 33. #sitMUC Example : Based on Real (Bypassing)  ABAP Case Study:
  • 34. #sitMUC Demo: Based on Games (Bypassing) https://xss-game.appspot.com/ http://xssplaygroundforfunandlearn.netai.net/series1.html https://html5sec.org/innerhtml/ (Mario Heiderich's Utility)
  • 36.  XSS (Cross Site Scripting) Prevention Cheat Sheet from OWASP  (HTML5 Security Clean Sheet)  Validation on XSS Input. Use White-Listing, Escaping and sanitization method. (Use Sanitizers) “Do not trust anything ever, specially when it comes to user input”  Understanding common browser behaviors that lead to XSS  Learning the best practices for your technology #sitMUC Preventions
  • 37. #sitMUC Latest News Salesforce plugs silly website XSS hole, hopes nobody spotted it (Mid August) Critical PayPal XSS vulnerability left accounts open to attack (Late August) eBay Fixes XSS Flaw in Subdomain (Early September) Netflix Sleepy Puppy Awakens XSS Vulnerabilities in Secondary Applications (Early September) Attackers exploit vulnerabilities in two WordPress plugins (Early May)
  • 38. #sitMUC Latest News 0-day XSS vulnerability on SAP website put customers’ data at risk of theft by hackers (Early May) SAP HANA Databases Vulnerable to XSS and SQL Injections (Late June) Overall: Almost ALL websites have serious security vulnerabilities, study shows
  • 39.  Lack enough Pen. Test ( 92% of the respondents perform penetration testing. 21% perform it annually, 26% perform it quarterly and 8% never perform penetration testing.)  Taking responsibility from the Developers  Unawareness of XSS vulnerability  Not taking seriously #sitMUC Challenges
  • 40. XSS is unavoidable at least nowadays ! Now its your job to raise the bar for attacker. “XSS is Everywhere” (Short and Simple) Use Prevention, Go for Solutions in the forms of layers, Keep Updated & Do regular Penetration Testing #sitMUC Conclusion
  • 42. Thank You Soumyasanto Sen @soumyasantoDr. Ashar Javed : http://slides.com/mscasharjaved/

Editor's Notes

  • #25: Bypass: width: ex/**/pression(alert(1)) ja&Tab;vasc&NewLine:ript&colon;alert&lpar;1&rpar;
  • #26: Bypass: <img src=x id=confirm(1) onerror=eval(id)
  • #27: Bypass: width:expression&#x28;alert&#x28;1&#x29;&#x29;