SlideShare a Scribd company logo
Security Concerns
Mobile Application Security
About
Priaum Talukder
Program: MSCSE
ID: 1612359050
Email: priaum.talukder@northsouth.edu
 https://www.linkedin.com/in/priamcse
 Course: CSE 597 / Seminar Topics
Course Teacher: Dr. Shazzad Hosain
 North South University
Previous Topics
 Top Issues Facing Mobile Devices
 Top Application Security Risks
 Injection
 Broken Authentication & Session Management
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 Type of injection.
 Malicious script injected on trusted or weak web
servers.
 Attacker Uses Web Application to sent
malicious code.
 Mostly uses client side application.
 Example: HTML, JavaScript, VBScript, ActiveX,
Flash etc.
Cross Site Scripting (XSS)
 Cross-Site Scripting (XSS) attacks occur when:
 Data enters a Web application through an untrusted
source, most frequently a web request.
 The data is included in dynamic content that is sent
to a web user without being validated for malicious
content.
XSS Example
 Example of malicious code
 Modification of the Document Object Model - DOM
(change some links, add some buttons)
 Send personal information to thirds (javascript can
send cookies to other sites)
Cross Site Scripting (XSS)
 Attacker Executes Script on the Victim’s
machine
 Is usually Javascript
 Can be any script language supported by the
victim’s browser
Types of XSS
 Three types of Cross Site Scripting
 Reflected
 Stored
 DOM injection
Reflected XSS Attacks
Reflected XSS Attacks
 Reflected XSS are the most frequent type of
XSS attacks found in the wild.
 Reflected attack is like phishing attack.
 Attacker sends the malicious code via website
url.
 Reflected attacks delivered to victim via email,
website url or by other medium.
 An attacker convinces a victim to visit a URL.
 After the site reflects the attacker's content back
to the victim, the content is executed by the
victim's browser.
Reflected XSS Attacks
 Injected script is reflected off the web server.
 such as in an error message
 search result
 or any other response
 that includes some or all of the input sent to the
server as part of the request.
Reflected XSS Attacks Example
 article.php?title=<meta%20http-
equiv="refresh"%20content="0;">
 This makes a refresh request roughly about
every .3 seconds to particular page. It then acts
like an infinite loop of refresh requests,
potentially bringing down the web and database
server by flooding it with requests. The more
browser sessions that are open, the more
intense the attack becomes.
Stored XSS Attacks
Stored XSS Attacks
 Stored attacks are those where the injected
script is permanently stored on the target
servers.
 such as in a database
 in a message forum
 visitor log
 comment field
 etc.
 The victim then retrieves the malicious script
from the server when it requests the stored
information.
Stored XSS Attacks
 Risk when large number of users can see
unfiltered content
 Very dangerous for Content Management Systems
(CMS)
 Blogs
 Forums
Stored XSS Attacks
 Stored XSS Attacks of cross-site scripting
vulnerability has the largest impact of all when
compared to other XSS variants because:
 It will affect every visitor of the targeted web
application
 Unless detected and manually removed, the
malicious code will remain active on the website,
thus having a very long term effect
 Web browser’s XSS protection mechanisms do not
detect and stop persistent XSS
DOM Based XSS Attacks
DOM Based XSS Attacks
 XSS Modifies the Document Object Model
(DOM)
 Javascript can manipulate all the document
 It can create new nodes
 Remove existing nodes
 Change the content of some nodes
 JavaScript is manipulated directly inside the
client
 Using misconfiguration of client side code
 Using flows in frameworks (AngularJS, JQuery, . . .
)
Example DOM Based XSS
 Suppose the following code is used to create a
form to let the user choose his/her preferred
language. A default language is also provided in
the query string, as the parameter “default”.
 Code
 <select><script>
 document.write("<OPTION
value=1>"+document.location.href.substring(do
cument.location.href.indexOf("default=")+8)+"</
OPTION>");
 document.write("<OPTION
value=2>English</OPTION>");
Example (Cont.)
A DOM Based XSS attack against this page can
be accomplished by sending the following URL to
a victim:
 http://www.some.site/page.html?default=<script
>alert(document.cookie)</script>
 When the victim clicks on this link, the browser
sends a request for:
 /page.html?default=<script>alert(document.coo
kie)</script>
 to www.some.site. The server responds with the
page containing the above Javascript code. The
browser creates a DOM object for the page, in
Prevention
Prevention (XSS Attack)
 By validating of all incoming data or input data.
 Appropriate encoding of all output data can
prevent this attack.
Input Validation
 Use Standard input validation mechanism
 Validate length, type, syntax and appropriate rules
 Use the “Accept known good” validation
 Reject invalid input
 Do not forget that error messages might also
include invalid data
Output Validation
 Ensure that all user-supplied data is
appropriately entity encoded before rendering
 HTML or XML depending on output mechanism
 means <script> is encoded &lt;script&gt;
 Set the character encoding for each page you
output
 specify the character encoding (e.g. ISO 8859-1 or
UTF 8)
 Do not allow attacker to choose this for your users
Reference
 OWASP Top 10 Mobile Risks by OWASP
 https://en.wikipedia.org/wiki/Cross-site_scripting
- by wikipedia
 https://www.owasp.org/index.php/Cross-
site_Scripting_(XSS) – by OWASP
 https://www.owasp.org/index.php/XSS_(Cross_
Site_Scripting)_Prevention_Cheat_Sheet by
OWASP
 https://www.owasp.org/index.php/Types_of_Cro
ss-Site_Scripting – Types of Cross Site
Scripting by OWASP
 http://www.acunetix.com/websitesecurity/cross-
Thank you!

More Related Content

What's hot (20)

PPTX
Cross-Site Scripting (XSS)
Daniel Tumser
 
PPTX
Cross site scripting
kinish kumar
 
PDF
XSS Magic tricks
GarethHeyes
 
PPTX
Xss ppt
penetration Tester
 
PDF
Cross site scripting attacks and defenses
Mohammed A. Imran
 
PDF
SSRF workshop
Ivan Novikov
 
PPTX
Cross Site Scripting ( XSS)
Amit Tyagi
 
PPTX
SSRF exploit the trust relationship
n|u - The Open Security Community
 
PPT
Secure code practices
Hina Rawal
 
PPTX
Deep understanding on Cross-Site Scripting and SQL Injection
Vishal Kumar
 
PPTX
Directory Traversal & File Inclusion Attacks
Raghav Bisht
 
PPTX
Web Security Attacks
Sajid Hasan
 
PPT
Cross Site Request Forgery
Tony Bibbs
 
PPT
A Brief Introduction in SQL Injection
Sina Manavi
 
PPTX
Xss attack
Manjushree Mashal
 
PPTX
Cross site scripting (xss)
Ritesh Gupta
 
PDF
The Cross Site Scripting Guide
Daisuke_Dan
 
PDF
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Sandeep Kumbhar
 
PPTX
Deep dive into ssrf
n|u - The Open Security Community
 
Cross-Site Scripting (XSS)
Daniel Tumser
 
Cross site scripting
kinish kumar
 
XSS Magic tricks
GarethHeyes
 
Cross site scripting attacks and defenses
Mohammed A. Imran
 
SSRF workshop
Ivan Novikov
 
Cross Site Scripting ( XSS)
Amit Tyagi
 
SSRF exploit the trust relationship
n|u - The Open Security Community
 
Secure code practices
Hina Rawal
 
Deep understanding on Cross-Site Scripting and SQL Injection
Vishal Kumar
 
Directory Traversal & File Inclusion Attacks
Raghav Bisht
 
Web Security Attacks
Sajid Hasan
 
Cross Site Request Forgery
Tony Bibbs
 
A Brief Introduction in SQL Injection
Sina Manavi
 
Xss attack
Manjushree Mashal
 
Cross site scripting (xss)
Ritesh Gupta
 
The Cross Site Scripting Guide
Daisuke_Dan
 
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Sandeep Kumbhar
 

Similar to Cross Site Scripting (XSS) (20)

PDF
XSS-Alert-Pentration testing tool
Arjun Jain
 
DOCX
logout.php Session Data after Logout Username Email . $_.docx
smile790243
 
PPT
Xss ppt
chanakyac1
 
PPTX
Xss_Hritwik_Roy.pptx@kjfbbwefhjoiqrw[i0-3envnvig87trhgohiulefvonvrivfgkmlghoi...
jafixew160
 
PPTX
Secure Code Warrior - Cross site scripting
Secure Code Warrior
 
PPT
Xssandcsrf
Prabhanshu Saraswat
 
PDF
Complete xss walkthrough
Ahmed Elhady Mohamed
 
PDF
xss-100908063522-phpapp02.pdf
yashvirsingh48
 
PDF
Session7-XSS & CSRF
zakieh alizadeh
 
PDF
Study of Cross-Site Scripting Attacks and Their Countermeasures
Editor IJCATR
 
PPT
Intro to Web Application Security
Rob Ragan
 
PDF
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET Journal
 
PDF
Prevention of Cross-Site Scripting using Hash Technique
IJCSIS Research Publications
 
PPT
Owasp Top 10 - Owasp Pune Chapter - January 2008
abhijitapatil
 
PPTX
STORED XSS IN DVWA
Rutvik patel
 
PDF
Introduction to Cross Site Scripting ( XSS )
Irfad Imtiaz
 
PPTX
XSS: From alert(1) to crypto mining malware
Omer Meshar
 
PPTX
Xss
Ilan Mindel
 
PPTX
.NET Security Topics
Shawn Gorrell
 
DOCX
Pantallas escaneo Sitio Web
andres1422
 
XSS-Alert-Pentration testing tool
Arjun Jain
 
logout.php Session Data after Logout Username Email . $_.docx
smile790243
 
Xss ppt
chanakyac1
 
Xss_Hritwik_Roy.pptx@kjfbbwefhjoiqrw[i0-3envnvig87trhgohiulefvonvrivfgkmlghoi...
jafixew160
 
Secure Code Warrior - Cross site scripting
Secure Code Warrior
 
Complete xss walkthrough
Ahmed Elhady Mohamed
 
xss-100908063522-phpapp02.pdf
yashvirsingh48
 
Session7-XSS & CSRF
zakieh alizadeh
 
Study of Cross-Site Scripting Attacks and Their Countermeasures
Editor IJCATR
 
Intro to Web Application Security
Rob Ragan
 
IRJET- A Survey on Various Cross-Site Scripting Attacks and Few Prevention Ap...
IRJET Journal
 
Prevention of Cross-Site Scripting using Hash Technique
IJCSIS Research Publications
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
abhijitapatil
 
STORED XSS IN DVWA
Rutvik patel
 
Introduction to Cross Site Scripting ( XSS )
Irfad Imtiaz
 
XSS: From alert(1) to crypto mining malware
Omer Meshar
 
.NET Security Topics
Shawn Gorrell
 
Pantallas escaneo Sitio Web
andres1422
 
Ad

Recently uploaded (20)

PPTX
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
PPT
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
PDF
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
PPTX
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
PDF
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
PPTX
西班牙武康大学毕业证书{UCAMOfferUCAM成绩单水印}原版制作
Taqyea
 
PPTX
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
PDF
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
PPTX
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
PPTX
Research Design - Report on seminar in thesis writing. PPTX
arvielobos1
 
PPT
Computer Securityyyyyyyy - Chapter 1.ppt
SolomonSB
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PPTX
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
PPTX
原版西班牙莱昂大学毕业证(León毕业证书)如何办理
Taqyea
 
PPTX
ZARA-Case.pptx djdkkdjnddkdoodkdxjidjdnhdjjdjx
RonnelPineda2
 
PPT
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
PDF
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
PDF
DevOps Design for different deployment options
henrymails
 
PPTX
INTEGRATION OF ICT IN LEARNING AND INCORPORATIING TECHNOLOGY
kvshardwork1235
 
PPTX
unit 2_2 copy right fdrgfdgfai and sm.pptx
nepmithibai2024
 
L1A Season 1 Guide made by A hegy Eng Grammar fixed
toszolder91
 
Agilent Optoelectronic Solutions for Mobile Application
andreashenniger2
 
Build Fast, Scale Faster: Milvus vs. Zilliz Cloud for Production-Ready AI
Zilliz
 
英国假毕业证诺森比亚大学成绩单GPA修改UNN学生卡网上可查学历成绩单
Taqyea
 
AI_MOD_1.pdf artificial intelligence notes
shreyarrce
 
西班牙武康大学毕业证书{UCAMOfferUCAM成绩单水印}原版制作
Taqyea
 
PM200.pptxghjgfhjghjghjghjghjghjghjghjghjghj
breadpaan921
 
The-Hidden-Dangers-of-Skipping-Penetration-Testing.pdf.pdf
naksh4thra
 
Optimization_Techniques_ML_Presentation.pptx
farispalayi
 
Research Design - Report on seminar in thesis writing. PPTX
arvielobos1
 
Computer Securityyyyyyyy - Chapter 1.ppt
SolomonSB
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
原版西班牙莱昂大学毕业证(León毕业证书)如何办理
Taqyea
 
ZARA-Case.pptx djdkkdjnddkdoodkdxjidjdnhdjjdjx
RonnelPineda2
 
Computer Securityyyyyyyy - Chapter 2.ppt
SolomonSB
 
Apple_Environmental_Progress_Report_2025.pdf
yiukwong
 
DevOps Design for different deployment options
henrymails
 
INTEGRATION OF ICT IN LEARNING AND INCORPORATIING TECHNOLOGY
kvshardwork1235
 
unit 2_2 copy right fdrgfdgfai and sm.pptx
nepmithibai2024
 
Ad

Cross Site Scripting (XSS)

  • 2. About Priaum Talukder Program: MSCSE ID: 1612359050 Email: [email protected]  https://www.linkedin.com/in/priamcse  Course: CSE 597 / Seminar Topics Course Teacher: Dr. Shazzad Hosain  North South University
  • 3. Previous Topics  Top Issues Facing Mobile Devices  Top Application Security Risks  Injection  Broken Authentication & Session Management
  • 5. Cross Site Scripting (XSS)  Type of injection.  Malicious script injected on trusted or weak web servers.  Attacker Uses Web Application to sent malicious code.  Mostly uses client side application.  Example: HTML, JavaScript, VBScript, ActiveX, Flash etc.
  • 6. Cross Site Scripting (XSS)  Cross-Site Scripting (XSS) attacks occur when:  Data enters a Web application through an untrusted source, most frequently a web request.  The data is included in dynamic content that is sent to a web user without being validated for malicious content.
  • 7. XSS Example  Example of malicious code  Modification of the Document Object Model - DOM (change some links, add some buttons)  Send personal information to thirds (javascript can send cookies to other sites)
  • 8. Cross Site Scripting (XSS)  Attacker Executes Script on the Victim’s machine  Is usually Javascript  Can be any script language supported by the victim’s browser
  • 9. Types of XSS  Three types of Cross Site Scripting  Reflected  Stored  DOM injection
  • 11. Reflected XSS Attacks  Reflected XSS are the most frequent type of XSS attacks found in the wild.  Reflected attack is like phishing attack.  Attacker sends the malicious code via website url.  Reflected attacks delivered to victim via email, website url or by other medium.  An attacker convinces a victim to visit a URL.  After the site reflects the attacker's content back to the victim, the content is executed by the victim's browser.
  • 12. Reflected XSS Attacks  Injected script is reflected off the web server.  such as in an error message  search result  or any other response  that includes some or all of the input sent to the server as part of the request.
  • 13. Reflected XSS Attacks Example  article.php?title=<meta%20http- equiv="refresh"%20content="0;">  This makes a refresh request roughly about every .3 seconds to particular page. It then acts like an infinite loop of refresh requests, potentially bringing down the web and database server by flooding it with requests. The more browser sessions that are open, the more intense the attack becomes.
  • 15. Stored XSS Attacks  Stored attacks are those where the injected script is permanently stored on the target servers.  such as in a database  in a message forum  visitor log  comment field  etc.  The victim then retrieves the malicious script from the server when it requests the stored information.
  • 16. Stored XSS Attacks  Risk when large number of users can see unfiltered content  Very dangerous for Content Management Systems (CMS)  Blogs  Forums
  • 17. Stored XSS Attacks  Stored XSS Attacks of cross-site scripting vulnerability has the largest impact of all when compared to other XSS variants because:  It will affect every visitor of the targeted web application  Unless detected and manually removed, the malicious code will remain active on the website, thus having a very long term effect  Web browser’s XSS protection mechanisms do not detect and stop persistent XSS
  • 18. DOM Based XSS Attacks
  • 19. DOM Based XSS Attacks  XSS Modifies the Document Object Model (DOM)  Javascript can manipulate all the document  It can create new nodes  Remove existing nodes  Change the content of some nodes  JavaScript is manipulated directly inside the client  Using misconfiguration of client side code  Using flows in frameworks (AngularJS, JQuery, . . . )
  • 20. Example DOM Based XSS  Suppose the following code is used to create a form to let the user choose his/her preferred language. A default language is also provided in the query string, as the parameter “default”.  Code  <select><script>  document.write("<OPTION value=1>"+document.location.href.substring(do cument.location.href.indexOf("default=")+8)+"</ OPTION>");  document.write("<OPTION value=2>English</OPTION>");
  • 21. Example (Cont.) A DOM Based XSS attack against this page can be accomplished by sending the following URL to a victim:  http://www.some.site/page.html?default=<script >alert(document.cookie)</script>  When the victim clicks on this link, the browser sends a request for:  /page.html?default=<script>alert(document.coo kie)</script>  to www.some.site. The server responds with the page containing the above Javascript code. The browser creates a DOM object for the page, in
  • 23. Prevention (XSS Attack)  By validating of all incoming data or input data.  Appropriate encoding of all output data can prevent this attack.
  • 24. Input Validation  Use Standard input validation mechanism  Validate length, type, syntax and appropriate rules  Use the “Accept known good” validation  Reject invalid input  Do not forget that error messages might also include invalid data
  • 25. Output Validation  Ensure that all user-supplied data is appropriately entity encoded before rendering  HTML or XML depending on output mechanism  means <script> is encoded &lt;script&gt;  Set the character encoding for each page you output  specify the character encoding (e.g. ISO 8859-1 or UTF 8)  Do not allow attacker to choose this for your users
  • 26. Reference  OWASP Top 10 Mobile Risks by OWASP  https://en.wikipedia.org/wiki/Cross-site_scripting - by wikipedia  https://www.owasp.org/index.php/Cross- site_Scripting_(XSS) – by OWASP  https://www.owasp.org/index.php/XSS_(Cross_ Site_Scripting)_Prevention_Cheat_Sheet by OWASP  https://www.owasp.org/index.php/Types_of_Cro ss-Site_Scripting – Types of Cross Site Scripting by OWASP  http://www.acunetix.com/websitesecurity/cross-