SlideShare a Scribd company logo
1 of 27
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

Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
Manish Kumar
 
The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting Guide
Daisuke_Dan
 
Dom based xss
Dom based xssDom based xss
Dom based xss
Lê Giáp
 
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
Marco Balduzzi
 

What's hot (20)

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
Cross site scriptingCross site scripting
Cross site scripting
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
Xss (cross site scripting)
Xss (cross site scripting)Xss (cross site scripting)
Xss (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
 
The Cross Site Scripting Guide
The Cross Site Scripting GuideThe Cross Site Scripting Guide
The Cross Site Scripting Guide
 
XSS- an application security vulnerability
XSS-   an application security vulnerabilityXSS-   an application security vulnerability
XSS- an application security vulnerability
 
Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)Cross Site Scripting: Prevention and Detection(XSS)
Cross Site Scripting: Prevention and Detection(XSS)
 
A8 cross site request forgery (csrf) it 6873 presentation
A8 cross site request forgery (csrf)   it 6873 presentationA8 cross site request forgery (csrf)   it 6873 presentation
A8 cross site request forgery (csrf) it 6873 presentation
 
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
 
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
 
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)
 
Secure Session Management
Secure Session ManagementSecure Session Management
Secure Session Management
 
Dom based xss
Dom based xssDom based xss
Dom based xss
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )
 
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbharCross site scripting (xss) attacks issues and defense - by sandeep kumbhar
Cross site scripting (xss) attacks issues and defense - by sandeep kumbhar
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
HTTP Parameter Pollution Vulnerabilities in Web Applications (Black Hat EU 2011)
 
File upload vulnerabilities & mitigation
File upload vulnerabilities & mitigationFile upload vulnerabilities & mitigation
File upload vulnerabilities & mitigation
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request Forgery
 

Similar to Cross Site Scripting (XSS)

logout.php Session Data after Logout Username Email . $_.docx
logout.php Session Data after Logout  Username  Email  . $_.docxlogout.php Session Data after Logout  Username  Email  . $_.docx
logout.php Session Data after Logout Username Email . $_.docx
smile790243
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdf
yashvirsingh48
 

Similar to Cross Site Scripting (XSS) (20)

XSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing toolXSS-Alert-Pentration testing tool
XSS-Alert-Pentration testing tool
 
logout.php Session Data after Logout Username Email . $_.docx
logout.php Session Data after Logout  Username  Email  . $_.docxlogout.php Session Data after Logout  Username  Email  . $_.docx
logout.php Session Data after Logout Username Email . $_.docx
 
Xss ppt
Xss pptXss ppt
Xss ppt
 
Secure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scriptingSecure Code Warrior - Cross site scripting
Secure Code Warrior - Cross site scripting
 
Xssandcsrf
XssandcsrfXssandcsrf
Xssandcsrf
 
Complete xss walkthrough
Complete xss walkthroughComplete xss walkthrough
Complete xss walkthrough
 
xss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdfxss-100908063522-phpapp02.pdf
xss-100908063522-phpapp02.pdf
 
Session7-XSS & CSRF
Session7-XSS & CSRFSession7-XSS & CSRF
Session7-XSS & CSRF
 
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
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application Security
 
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...
 
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
 
Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008Owasp Top 10 - Owasp Pune Chapter - January 2008
Owasp Top 10 - Owasp Pune Chapter - January 2008
 
STORED XSS IN DVWA
STORED XSS IN DVWASTORED XSS IN DVWA
STORED XSS IN DVWA
 
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
 
Xss
XssXss
Xss
 
.NET Security Topics
.NET Security Topics.NET Security Topics
.NET Security Topics
 
Pantallas escaneo Sitio Web
Pantallas escaneo Sitio WebPantallas escaneo Sitio Web
Pantallas escaneo Sitio Web
 
Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )Website hacking and prevention (All Tools,Topics & Technique )
Website hacking and prevention (All Tools,Topics & Technique )
 
04. xss and encoding
04.  xss and encoding04.  xss and encoding
04. xss and encoding
 

Recently uploaded

Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
ellan12
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
sexy call girls service in goa
 

Recently uploaded (20)

GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark WebGDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
GDG Cloud Southlake 32: Kyle Hettinger: Demystifying the Dark Web
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Dlf City Phase 3 Gurgaon >༒8448380779 Escort Service
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Ashram Chowk Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Prashant Vihar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 

Cross Site Scripting (XSS)

  • 2. 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
  • 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-