SlideShare a Scribd company logo
23/02/2011




                                                                                                                                           Cross Site Scripting (XSS)

                                                                                                                               • Is a type of computer security vulnerability
                                                                                                                                 typically found in web applications that enables
                                                                                                                                 malicious attackers to inject client-side script into
            Cross Site Scripting (XSS)
                                                                                                                                 web pages viewed by other users
                                                                                                                               • The attack steals access credentials, executes
                                                                                                                                 denial-of-service and modifies web pages in
                                                                                                                                 order to execute any command at the client
                                                                                                                                 machine




                                                                                                                                                          The players
                     Input Vulnerabilities
                                                                                                                                  – An Attacker
1. A Web application that accepts user input                                                                                         • Anonymous Internet User
                                                                                                                                     • Malicious Internal User
                                                                                                                                  – A company’s Web server (i.e. Web application)
2. The input is used to create dynamic content
                                                                                                                                     • External (e.g.: Shop, Information, CRM,
                                                                                                                                       Supplier)
3. The input is insufficiently validated                                                                                             • Internal (e.g.: Employees Self Service Portal)
                                                                                                                                  – A Client
                                                                                                                                     • Any type of customer
                                                                                                                                     • Anonymous user accessing the Web-Server




                                   XSS Steps                                                                                                      Example: XSS (jsp)

   Attacker                                               Web Server
                     Post Forum Message:                                              Did you know this?
                     Subject: GET Money for FREE !!!                                  .....
                                                                                                                                http://myserver.com/test.jsp?name=Stefan
                                                                                        GET Money for FREE !!!
                     Body:
                                                                                        <script> attack code </script>
                     <script> attack code </script>                                                                                                                         <HTML>
                                                                                         Re: Error message on startup
                                                                                         .....
                                                                                           I found a solution!
                                                                                                                                                                            <Body>
                                                                                           .....
                                                                                              Can anybody help?                                                             Welcome Stefan
                                                                                              .....
                                          Get /forum.jsp?fid=122&mid=2241
                                                                                                Error message on startup                                                    </Body>
                                                                                                .....
                                                                                                                                                                            </HTML>
    1. Attacker sends malicious code
                                                                                                                                http://myserver.com/welcome.jsp?name=<script>alert("Attacked")</script>
    2. Server stores message                                          GET Money for FREE !!!
                                                                      <script> attack code </script>
                                                                                                                                                                                   <HTML>
    3. User requests message                                                                                                                                                       <Body>
    4. Message is delivered by server                                          Client                                                                                              Welcome
                                                                                                                                                                                   <script>alert("Attacked")</
    5. Browser executes script in message                                         !!! attack code !!!                                                                              script>
                                                                                                                                               (c) 2005, EUROSEC GmbH Chiffriertechnik & Sicherheit
                                                                                                                                                                                   </Body>                       6

                  (c) 2005, EUROSEC GmbH Chiffriertechnik & Sicherheit                                                     5                                                       </HTML>




                                                                                                                                                                                                                     1
23/02/2011




                        Mitigation                                                   Mitigation

• Input Validation                                            • Implement Cookie Options
  – Check if the input is what you expect                       – "httpOnly" Cookies
                                                                   • Prevent disclosure of cookie via DOM access
     • Do not try to check for "bad input"
                                                                       – use with care, browser compatibility problems may occur
  – Whitelist testing is better                                    • But: cookies are sent in each HTTP requests
                                                                       – E.G. Trace-Method can be used to disclose cookie
     • Only what you expect will pass
                                                                   • Passwords still may be stolen via XSS
     • (correct) Regular expressions                            – "secure" Cookies
  * Blacklist testing is no solution because blacklists are        • Cookies are only sent over SSL

    never complete.




                        Mitigation                                                   Mitigation

• Use Web Application Firewalls                               • XSS-Prevention Best Practices
  – Check for malicous input values                             – Implement the mentioned XSS-Mitigation in
  – Check for modification of read-only parameters                applications
  – Block requests or filter out parameters                     – Do not assume input values are benign
                                                                – Do not trust client side validation
                                                                – Check and validate all input before processing
                                                                – Do not echo any input value without validation
                                                                – Use one conceptual solution in all applications




                                                                                                                                    2

More Related Content

Similar to Api xss

Web Application Vulnerabilities
Web Application VulnerabilitiesWeb Application Vulnerabilities
Web Application Vulnerabilities
Preetish Panda
 
Isys20261 lecture 09
Isys20261 lecture 09Isys20261 lecture 09
Isys20261 lecture 09
Wiliam Ferraciolli
 
Cyber Security By Preetish Panda
Cyber Security By Preetish PandaCyber Security By Preetish Panda
Cyber Security By Preetish Panda
Preetish Panda
 
Web application security
Web application securityWeb application security
Web application security
Akhil Raj
 
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
Sam Bowne
 
a
aa
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site ScriptingCNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
Sam Bowne
 
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site ScriptingCNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
Sam Bowne
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
Niyas Nazar
 
Ch 12 Attacking Users - XSS
Ch 12 Attacking Users - XSSCh 12 Attacking Users - XSS
Ch 12 Attacking Users - XSS
Sam Bowne
 
웹 개발을 위해 꼭 알아야하는 보안 공격
웹 개발을 위해 꼭 알아야하는 보안 공격웹 개발을 위해 꼭 알아야하는 보안 공격
웹 개발을 위해 꼭 알아야하는 보안 공격
선협 이
 
Web Security
Web SecurityWeb Security
Web Security
Ali Habeeb
 
www.webre24h.com - Ajax security
www.webre24h.com - Ajax securitywww.webre24h.com - Ajax security
www.webre24h.com - Ajax security
webre24h
 
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
Michael Coates
 
Vulnerabilities in Web Applications
Vulnerabilities in Web ApplicationsVulnerabilities in Web Applications
Vulnerabilities in Web Applications
Venkat Ramana Reddy Parine
 
Cross site scripting
Cross site scripting Cross site scripting
XSS Remediation
XSS RemediationXSS Remediation
XSS Remediation
Denim Group
 
Computer Network Case Study - bajju.pptx
Computer Network Case Study - bajju.pptxComputer Network Case Study - bajju.pptx
Computer Network Case Study - bajju.pptx
ShivamBajaj36
 
Web application security part 01
Web application security part 01Web application security part 01
Web application security part 01
G Prachi
 
Chapter 13 web security
Chapter 13 web securityChapter 13 web security
Chapter 13 web security
newbie2019
 

Similar to Api xss (20)

Web Application Vulnerabilities
Web Application VulnerabilitiesWeb Application Vulnerabilities
Web Application Vulnerabilities
 
Isys20261 lecture 09
Isys20261 lecture 09Isys20261 lecture 09
Isys20261 lecture 09
 
Cyber Security By Preetish Panda
Cyber Security By Preetish PandaCyber Security By Preetish Panda
Cyber Security By Preetish Panda
 
Web application security
Web application securityWeb application security
Web application security
 
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
CNIT 129S: 12: Attacking Users: Cross-Site Scripting (Part 1 of 2)
 
a
aa
a
 
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site ScriptingCNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
 
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site ScriptingCNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
CNIT 129S: Ch 12: Attacking Users: Cross-Site Scripting
 
Vulnerabilities in modern web applications
Vulnerabilities in modern web applicationsVulnerabilities in modern web applications
Vulnerabilities in modern web applications
 
Ch 12 Attacking Users - XSS
Ch 12 Attacking Users - XSSCh 12 Attacking Users - XSS
Ch 12 Attacking Users - XSS
 
웹 개발을 위해 꼭 알아야하는 보안 공격
웹 개발을 위해 꼭 알아야하는 보안 공격웹 개발을 위해 꼭 알아야하는 보안 공격
웹 개발을 위해 꼭 알아야하는 보안 공격
 
Web Security
Web SecurityWeb Security
Web Security
 
www.webre24h.com - Ajax security
www.webre24h.com - Ajax securitywww.webre24h.com - Ajax security
www.webre24h.com - Ajax security
 
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
 
Vulnerabilities in Web Applications
Vulnerabilities in Web ApplicationsVulnerabilities in Web Applications
Vulnerabilities in Web Applications
 
Cross site scripting
Cross site scripting Cross site scripting
Cross site scripting
 
XSS Remediation
XSS RemediationXSS Remediation
XSS Remediation
 
Computer Network Case Study - bajju.pptx
Computer Network Case Study - bajju.pptxComputer Network Case Study - bajju.pptx
Computer Network Case Study - bajju.pptx
 
Web application security part 01
Web application security part 01Web application security part 01
Web application security part 01
 
Chapter 13 web security
Chapter 13 web securityChapter 13 web security
Chapter 13 web security
 

Recently uploaded

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 

Recently uploaded (20)

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 

Api xss

  • 1. 23/02/2011 Cross Site Scripting (XSS) • Is a type of computer security vulnerability typically found in web applications that enables malicious attackers to inject client-side script into Cross Site Scripting (XSS) web pages viewed by other users • The attack steals access credentials, executes denial-of-service and modifies web pages in order to execute any command at the client machine The players Input Vulnerabilities – An Attacker 1. A Web application that accepts user input • Anonymous Internet User • Malicious Internal User – A company’s Web server (i.e. Web application) 2. The input is used to create dynamic content • External (e.g.: Shop, Information, CRM, Supplier) 3. The input is insufficiently validated • Internal (e.g.: Employees Self Service Portal) – A Client • Any type of customer • Anonymous user accessing the Web-Server XSS Steps Example: XSS (jsp) Attacker Web Server Post Forum Message: Did you know this? Subject: GET Money for FREE !!! ..... http://myserver.com/test.jsp?name=Stefan GET Money for FREE !!! Body: <script> attack code </script> <script> attack code </script> <HTML> Re: Error message on startup ..... I found a solution! <Body> ..... Can anybody help? Welcome Stefan ..... Get /forum.jsp?fid=122&mid=2241 Error message on startup </Body> ..... </HTML> 1. Attacker sends malicious code http://myserver.com/welcome.jsp?name=<script>alert("Attacked")</script> 2. Server stores message GET Money for FREE !!! <script> attack code </script> <HTML> 3. User requests message <Body> 4. Message is delivered by server Client Welcome <script>alert("Attacked")</ 5. Browser executes script in message !!! attack code !!! script> (c) 2005, EUROSEC GmbH Chiffriertechnik & Sicherheit </Body> 6 (c) 2005, EUROSEC GmbH Chiffriertechnik & Sicherheit 5 </HTML> 1
  • 2. 23/02/2011 Mitigation Mitigation • Input Validation • Implement Cookie Options – Check if the input is what you expect – "httpOnly" Cookies • Prevent disclosure of cookie via DOM access • Do not try to check for "bad input" – use with care, browser compatibility problems may occur – Whitelist testing is better • But: cookies are sent in each HTTP requests – E.G. Trace-Method can be used to disclose cookie • Only what you expect will pass • Passwords still may be stolen via XSS • (correct) Regular expressions – "secure" Cookies * Blacklist testing is no solution because blacklists are • Cookies are only sent over SSL never complete. Mitigation Mitigation • Use Web Application Firewalls • XSS-Prevention Best Practices – Check for malicous input values – Implement the mentioned XSS-Mitigation in – Check for modification of read-only parameters applications – Block requests or filter out parameters – Do not assume input values are benign – Do not trust client side validation – Check and validate all input before processing – Do not echo any input value without validation – Use one conceptual solution in all applications 2