SlideShare a Scribd company logo
1 of 16
Download to read offline
Cross-Site Scripting (XSS)
Attacks
Issues and Defense
by
Sandeep Kumbhar
M. Tech CSE, R N S I T
Bangalore
Contents
 Introduction
 Impact of XSS attacks
 Types of XSS attacks
 Detection of XSS attacks
 Prevention of XSS attacks
 At client side
 At Server side
 Conclusion
 References
Dept. of CSE, RNSIT 2012-13 1
XSS Issues and Defence
Introduction
 What is XSS attack?
 Why it is popular?
 Inputs for XSS attacks?
Dept. of CSE, RNSIT 2012-13 2
XSS Issues and Defence
Impact of XSS attack
 Access to authentication credentials for Web application
 Cookies, Username and Password
 XSS is not a harmless flaw
 Normal users
 Access to personal data (Credit card, Bank Account)
 Misuse account (order expensive goods)
 Denial-of-Service
 Crash User’s Browser, Pop-Up-Flooding, Redirection Access to
user’s machine
 Use ActiveX objects to control machine
 Upload local data to attacker's machine
 Spoil public image of company
 Load main frame content from other locations
Dept. of CSE, RNSIT 2012-13 4
XSS Issues and Defence
Types of XSS Attacks
Dept. of CSE, RNSIT 2012-13 3
 Non-persistent or Reflected Cross-Site
Scripting attacks
 Persistent or Stored Cross-Site Scripting
attacks
 DOM based Cross-Site Scripting attacks
XSS Issues and Defence
Reflected XSS Attacks
 Attacker provided script is embedded in the web page generated by
the server as an immediate response of an HTTP request.
Dept. of CSE, RNSIT 2012-13 5
http://myserver.com/test.jsp?name=Stefan
<HTML>
<Body>
Welcome Stefan
</Body>
</HTML>
XSS Issues and Defence
Dept. of CSE, RNSIT 2012-13 6
http://myserver.com/welcome.jsp?name=<script>alert("Attacked")</script>
<HTML>
<Body>
Welcome <script>alert("Attacked")</script>
</Body>
</HTML>
XSS Issues and Defence
Stored XSS Attacks
 Attacker provided script is stored to a database and later retrieved and
embedded in the web page generated by the server
Dept. of CSE, RNSIT 2012-13 7
XSS Issues and Defence
Dept. of CSE, RNSIT 2012-13 8
Unvalidated Input resulted in a Cross-Site Scripting Attack and the
theft of the Administrator’s Cookie
XSS Issues and Defence
Detection Of XSS
 Check if special characters are encoded
<XSS> vs. &ltXSS&gt
 Check if a double quote escape can be evaded
<script>alert(String.fromCharCode(88, 83, 83));<script>
 Check if script can be executed
<script>alert(“XSS”)</script>
Dept. of CSE, RNSIT 2012-13 9
XSS Issues and Defence
Detection Of XSS Cont..
 Check if input filtering can be evaded
<SCRIPT>alert("XSS");//</SCRIPT>
 Denial of service
<script>alert(document.cookie);</script>article.php?title=
<meta%20httpequiv="refresh"%20content="0;">
Dept. of CSE, RNSIT 2012-13 10
XSS Issues and Defence
Prevention of XSS Attacks
- At Client/Browser Side
Dept. of CSE, RNSIT 2012-13 11
XSS Issues and Defence
Figure: Architecture for Cross-Site Scripting in Browser side
Prevention of XSS Attacks
- At Server Side
Dept. of CSE, RNSIT 2012-13 12
XSS Issues and Defence
Figure: Architecture for Cross-Site Scripting in Server side
Conclusion
Dept. of CSE, RNSIT 2012-13 13
XSS Issues and Defence
 Always practice using testing tools during the design phase to eliminate
XSS holes in the application.
 Input validation and HTML escaping are essential, yet that must be
applied at all application points accepting data.
 There is a misconception sometimes applied to XSS holes in general
which leads to a disagreement in the security community as to the
importance of cross-site scripting vulnerabilities.
 XSS-Prevention Best Practices
 Implement XSS-Prevention in application
 Do not assume input values are always good
 Do not trust client side validation
 Check and validate all input before processing
 Do not echo any input value without validation
 Use one conceptual solution in all applications
References
[1] Client-side cross-site scripting protection byEngin Kirdaa,*, Nenad Jovanovicb,
Christopher Kruegelc, Giovanni Vignac (a)Institute Eurecom, France (b) Secure
Systems Lab, Technical University Vienna, Austria (c) University of California, Santa
Barbara, USA
[2] A Server Side Solution for Protection of Web Applications from Cross-Site Scripting
Attacks A. Duraisamy, M.Sathiyamoorthy, S.Chandrasekar International Journal of
Innovative Technology and Exploring Engineering (IJITEE) ISSN: 2278 - 3075,
Volume-2, Issue-4, March 2013
[3] Prevention Of Cross-Site Scripting Attacks (XSS) On Web Applications In The Client
Side S.SHALINI, S.USHA Engineering College, Chennai- 44, Tamilnadu,
IndiaDepartment of Computer and Communication, Sri Sairam IJCSI International
Journal of Computer Science Issues, Vol. 8, Issue 4, No 1, July 2011 ISSN (Online):
1694-0814 www.IJCSI.org
[4] A Server Side Solution for Protection of Web Applications from Cross-Site Scripting
Attacks A. Duraisamy, M.Sathiyamoorthy, S.Chandrasekar
[5] Protection of Web Applications from Cross-Site Scripting Attacks in Browser Side K.
Selvamani Department of Computer Science and Engineering Anna University,
Chennai, India
Dept. of CSE, RNSIT 2012-13 14
XSS Issues and Defence
Thank You.!

More Related Content

What's hot

The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting Guide
Daisuke_Dan
 

What's hot (20)

Xss attack
Xss attackXss attack
Xss attack
 
Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)Top 10 Web Security Vulnerabilities (OWASP Top 10)
Top 10 Web Security Vulnerabilities (OWASP Top 10)
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
Owasp Top 10 A1: Injection
Owasp Top 10 A1: InjectionOwasp Top 10 A1: Injection
Owasp Top 10 A1: Injection
 
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
 
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
 
Sql injection bypassing hand book blackrose
Sql injection bypassing hand book blackroseSql injection bypassing hand book blackrose
Sql injection bypassing hand book blackrose
 
Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
 
Owasp top 10 vulnerabilities
Owasp top 10 vulnerabilitiesOwasp top 10 vulnerabilities
Owasp top 10 vulnerabilities
 
Introduction to Web Application Penetration Testing
Introduction to Web Application Penetration TestingIntroduction to Web Application Penetration Testing
Introduction to Web Application Penetration Testing
 
XSS- an application security vulnerability
XSS-   an application security vulnerabilityXSS-   an application security vulnerability
XSS- an application security vulnerability
 
The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting Guide
 
SQL Injection
SQL Injection SQL Injection
SQL Injection
 
CSRF Basics
CSRF BasicsCSRF Basics
CSRF Basics
 
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)
 
Sql injection
Sql injectionSql injection
Sql injection
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Deep dive into ssrf
 
Sql injection in cybersecurity
Sql injection in cybersecuritySql injection in cybersecurity
Sql injection in cybersecurity
 
SQL injection
SQL injectionSQL injection
SQL injection
 

Similar to Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar

Software Security Engineering
Software Security EngineeringSoftware Security Engineering
Software Security Engineering
Marco Morana
 
Analysis of XSS attack Mitigation techniques based on Platforms and Browsers
Analysis of XSS attack Mitigation techniques based on Platforms and BrowsersAnalysis of XSS attack Mitigation techniques based on Platforms and Browsers
Analysis of XSS attack Mitigation techniques based on Platforms and Browsers
cscpconf
 
OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root Causes
Marco Morana
 
Routine Detection Of Web Application Defence Flaws
Routine Detection Of Web Application Defence FlawsRoutine Detection Of Web Application Defence Flaws
Routine Detection Of Web Application Defence Flaws
IJTET Journal
 

Similar to Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar (20)

XSS: From alert(1) to crypto mining malware
XSS: From alert(1) to crypto mining malwareXSS: From alert(1) to crypto mining malware
XSS: From alert(1) to crypto mining malware
 
Tracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern ScriptsTracing out Cross Site Scripting Vulnerabilities in Modern Scripts
Tracing out Cross Site Scripting Vulnerabilities in Modern Scripts
 
Cross Site Scripting Attacks and Preventive Measures
Cross Site Scripting Attacks and Preventive MeasuresCross Site Scripting Attacks and Preventive Measures
Cross Site Scripting Attacks and Preventive Measures
 
Software Security Engineering
Software Security EngineeringSoftware Security Engineering
Software Security Engineering
 
Analysis of XSS attack Mitigation techniques based on Platforms and Browsers
Analysis of XSS attack Mitigation techniques based on Platforms and BrowsersAnalysis of XSS attack Mitigation techniques based on Platforms and Browsers
Analysis of XSS attack Mitigation techniques based on Platforms and Browsers
 
XSS filter on Server side
XSS filter on Server sideXSS filter on Server side
XSS filter on Server side
 
Security in the cloud protecting your cloud apps
Security in the cloud   protecting your cloud appsSecurity in the cloud   protecting your cloud apps
Security in the cloud protecting your cloud apps
 
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
 
Application Security Architecture and Threat Modelling
Application Security Architecture and Threat ModellingApplication Security Architecture and Threat Modelling
Application Security Architecture and Threat Modelling
 
C01461422
C01461422C01461422
C01461422
 
Study of Cross-Site Scripting Attacks and Their Countermeasures
Study of Cross-Site Scripting Attacks and Their CountermeasuresStudy of Cross-Site Scripting Attacks and Their Countermeasures
Study of Cross-Site Scripting Attacks and Their Countermeasures
 
Web security 2010
Web security 2010Web security 2010
Web security 2010
 
ImageSubXSS: an image substitute technique to prevent Cross-Site Scripting at...
ImageSubXSS: an image substitute technique to prevent Cross-Site Scripting at...ImageSubXSS: an image substitute technique to prevent Cross-Site Scripting at...
ImageSubXSS: an image substitute technique to prevent Cross-Site Scripting at...
 
XSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing toolXSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing tool
 
Discovering the Value of Verifying Web Application Security Using IBM Rationa...
Discovering the Value of Verifying Web Application Security Using IBM Rationa...Discovering the Value of Verifying Web Application Security Using IBM Rationa...
Discovering the Value of Verifying Web Application Security Using IBM Rationa...
 
OWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root CausesOWASP Top 10 And Insecure Software Root Causes
OWASP Top 10 And Insecure Software Root Causes
 
Web application security I
Web application security IWeb application security I
Web application security I
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
Prevention of Cross-Site Scripting using Hash Technique
Prevention of Cross-Site Scripting using Hash TechniquePrevention of Cross-Site Scripting using Hash Technique
Prevention of Cross-Site Scripting using Hash Technique
 
Routine Detection Of Web Application Defence Flaws
Routine Detection Of Web Application Defence FlawsRoutine Detection Of Web Application Defence Flaws
Routine Detection Of Web Application Defence Flaws
 

Recently uploaded

一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
F
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
ydyuyu
 

Recently uploaded (20)

一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime BalliaBallia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
Ballia Escorts Service Girl ^ 9332606886, WhatsApp Anytime Ballia
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 

Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar

  • 1. Cross-Site Scripting (XSS) Attacks Issues and Defense by Sandeep Kumbhar M. Tech CSE, R N S I T Bangalore
  • 2. Contents  Introduction  Impact of XSS attacks  Types of XSS attacks  Detection of XSS attacks  Prevention of XSS attacks  At client side  At Server side  Conclusion  References Dept. of CSE, RNSIT 2012-13 1 XSS Issues and Defence
  • 3. Introduction  What is XSS attack?  Why it is popular?  Inputs for XSS attacks? Dept. of CSE, RNSIT 2012-13 2 XSS Issues and Defence
  • 4. Impact of XSS attack  Access to authentication credentials for Web application  Cookies, Username and Password  XSS is not a harmless flaw  Normal users  Access to personal data (Credit card, Bank Account)  Misuse account (order expensive goods)  Denial-of-Service  Crash User’s Browser, Pop-Up-Flooding, Redirection Access to user’s machine  Use ActiveX objects to control machine  Upload local data to attacker's machine  Spoil public image of company  Load main frame content from other locations Dept. of CSE, RNSIT 2012-13 4 XSS Issues and Defence
  • 5. Types of XSS Attacks Dept. of CSE, RNSIT 2012-13 3  Non-persistent or Reflected Cross-Site Scripting attacks  Persistent or Stored Cross-Site Scripting attacks  DOM based Cross-Site Scripting attacks XSS Issues and Defence
  • 6. Reflected XSS Attacks  Attacker provided script is embedded in the web page generated by the server as an immediate response of an HTTP request. Dept. of CSE, RNSIT 2012-13 5 http://myserver.com/test.jsp?name=Stefan <HTML> <Body> Welcome Stefan </Body> </HTML> XSS Issues and Defence
  • 7. Dept. of CSE, RNSIT 2012-13 6 http://myserver.com/welcome.jsp?name=<script>alert("Attacked")</script> <HTML> <Body> Welcome <script>alert("Attacked")</script> </Body> </HTML> XSS Issues and Defence
  • 8. Stored XSS Attacks  Attacker provided script is stored to a database and later retrieved and embedded in the web page generated by the server Dept. of CSE, RNSIT 2012-13 7 XSS Issues and Defence
  • 9. Dept. of CSE, RNSIT 2012-13 8 Unvalidated Input resulted in a Cross-Site Scripting Attack and the theft of the Administrator’s Cookie XSS Issues and Defence
  • 10. Detection Of XSS  Check if special characters are encoded <XSS> vs. &ltXSS&gt  Check if a double quote escape can be evaded <script>alert(String.fromCharCode(88, 83, 83));<script>  Check if script can be executed <script>alert(“XSS”)</script> Dept. of CSE, RNSIT 2012-13 9 XSS Issues and Defence
  • 11. Detection Of XSS Cont..  Check if input filtering can be evaded <SCRIPT>alert("XSS");//</SCRIPT>  Denial of service <script>alert(document.cookie);</script>article.php?title= <meta%20httpequiv="refresh"%20content="0;"> Dept. of CSE, RNSIT 2012-13 10 XSS Issues and Defence
  • 12. Prevention of XSS Attacks - At Client/Browser Side Dept. of CSE, RNSIT 2012-13 11 XSS Issues and Defence Figure: Architecture for Cross-Site Scripting in Browser side
  • 13. Prevention of XSS Attacks - At Server Side Dept. of CSE, RNSIT 2012-13 12 XSS Issues and Defence Figure: Architecture for Cross-Site Scripting in Server side
  • 14. Conclusion Dept. of CSE, RNSIT 2012-13 13 XSS Issues and Defence  Always practice using testing tools during the design phase to eliminate XSS holes in the application.  Input validation and HTML escaping are essential, yet that must be applied at all application points accepting data.  There is a misconception sometimes applied to XSS holes in general which leads to a disagreement in the security community as to the importance of cross-site scripting vulnerabilities.  XSS-Prevention Best Practices  Implement XSS-Prevention in application  Do not assume input values are always good  Do not trust client side validation  Check and validate all input before processing  Do not echo any input value without validation  Use one conceptual solution in all applications
  • 15. References [1] Client-side cross-site scripting protection byEngin Kirdaa,*, Nenad Jovanovicb, Christopher Kruegelc, Giovanni Vignac (a)Institute Eurecom, France (b) Secure Systems Lab, Technical University Vienna, Austria (c) University of California, Santa Barbara, USA [2] A Server Side Solution for Protection of Web Applications from Cross-Site Scripting Attacks A. Duraisamy, M.Sathiyamoorthy, S.Chandrasekar International Journal of Innovative Technology and Exploring Engineering (IJITEE) ISSN: 2278 - 3075, Volume-2, Issue-4, March 2013 [3] Prevention Of Cross-Site Scripting Attacks (XSS) On Web Applications In The Client Side S.SHALINI, S.USHA Engineering College, Chennai- 44, Tamilnadu, IndiaDepartment of Computer and Communication, Sri Sairam IJCSI International Journal of Computer Science Issues, Vol. 8, Issue 4, No 1, July 2011 ISSN (Online): 1694-0814 www.IJCSI.org [4] A Server Side Solution for Protection of Web Applications from Cross-Site Scripting Attacks A. Duraisamy, M.Sathiyamoorthy, S.Chandrasekar [5] Protection of Web Applications from Cross-Site Scripting Attacks in Browser Side K. Selvamani Department of Computer Science and Engineering Anna University, Chennai, India Dept. of CSE, RNSIT 2012-13 14 XSS Issues and Defence