SlideShare una empresa de Scribd logo
1 de 44
© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Understanding
Cross-site
Request Forgery
Daniel Miessler
Principal Security Architect, HP Fortify
May 2013
Daniel Miessler, CISSP, CISA, GCIA
Principal Security Architect, HP Fortify
- 10 years experience doing security testing
- 5 years experience doing appsec testing
- Web Application Vulnerability Assessments
- Mobile Application Vulnerability Assessments
- Application Security Process Development
- Enterprise Security Consulting
daniel.miessler@hp.com
Introductions
Agenda
- Problem
- Basics
- Description
- Validation
- Defenses
- Attack Vectors
- CSRF Tester
- Takeaways
© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Problem
Problem | Overview
 CSRF is an OWASP Top 10 vulnerability but it’s not as
well understood as many others
 Many struggle with how to validate it
 Customers have difficulty explaining to management
why it’s important to fix
 We need to be well-versed in the main points to help
the customer with their narrative to management
© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Basics
Basics | Overview
 Often abbreviated as “CSRF” and pronounced as
“Sea Surf”
 #5 on the 2010 OWASP Top 10
 #8 on the 2013 OWASP Top 10
Basics | OWASP
Basics | Description
“Cross-site Request Forgery is a
vulnerability in a website that allows
attackers to force victims to perform
security-sensitive actions on that site
without their knowledge.”
Basics | Description
Let’s unpack that.
Basics | Description
“Cross-site Request Forgery is a
vulnerability in a website that allows
attackers to force victims to perform
security-sensitive actions on that site
without their knowledge.”
Basics | Description
“Cross-site Request Forgery is a
vulnerability in a website that allows
attackers to force victims to perform
security-sensitive actions on that site
without their knowledge.”
Basics | Description
“Cross-site Request Forgery is a
vulnerability in a website that allows
attackers to force victims to perform
security-sensitive actions on that site
without their knowledge.”
Basics | Description
 What do we mean by “sensitive actions”?
 How do attackers “force” victims to perform
them?
 And how do the victims not know it’s
happening?
1. The target is a sensitive operation in the
application, e.g. UpdateSalary.aspx, that’s able to
be tricked into executing.
2. Victims can be forced to execute this action through
any method that gets them to load a resource
automatically, e.g. img tag, script tag, onload form
submit, etc. Note: credentials go with all requests!
3. These happen unknowingly because the actions are
performed by the victim’s browser, not by the victim
explicitly.
Basics | Description
Sensitive action examples:
 /EditDocument.aspx
 /Login.do
 /CreateAdmin.php
 /UpdateStatus/
Basics | Examples
Forcing the victim to execute the action
(GET):
- <img
src=“http://site.com/transfer.php?fromac
ct=2042&toacct=4497 /> (GET)
Basics | Forced POSTs
Forcing the victim to execute the action
(POST):
Basics | Description
Both XSS and CSRF are possible due to abused
trust relationships:
 In XSS the browser will run malicious JavaScript because it was served
from a site (origin) it trusts.
 In CSRF the server will perform a sensitive action because it was sent
by a client that it trusts.
Basics | Trust Abuse
© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Validation
Validation | Criteria
If you can’t change something using your CSRF
vulnerability, then you don’t have one.
Examples of state changes:
- Updating an account (new password?)
- Transferring funds
- Changing the role of a user
- Ordering an item
- Adding an administrator to a system
Validation | Criteria
If your CSRF vulnerability doesn’t change
something sensitive, then you might not have
one.
Note: sensitivity is a…sensitive matter. Who is it
sensitive to? Could it be sensitive to some and
not others?
 Many changes are insignificant
 Remember that if the business understands the technical
risk then they automatically win the “what matters”
argument
Validation | Criteria
If requests for your CSRF vulnerability are
unique, you might not have one.
Things to check for uniqueness:
- Nonces
- CAPTCHA
- Multiple authentication levels
Validation | Criteria
The three components again…
1. Can you change state using it?
2. Is the function sensitive?
3. Is the request non-unique?
 This is the core of the validation process
 Any customer asking you to validate a CSRF
vulnerability should hear and learn these same
concepts
Validation | WebInspect
How WebInspect identifies CSRF:
1. Log in to the site
2. Complete a form and generate post request with current session
cookies
3. If response is 30X, follow the redirection (with current session
cookies) until the non-30x response is reached. This is response #1
(R1)
4. Log out and log in the site with different credentials (note session
cookies should be changed here)
5. Resend the same POST request as in step 2, but with the new
cookies
6. If necessary, follow redirects per step 3
7. Note the response as R2
8. If R1==R2, then it’s a non-unique request and therefore is CSRF-able
Validation | Manual Validation
How to manually verify CSRF:
1. Configure a proxy to observe traffic
2. Log in to the site with the issue in question
3. Perform the target functionality normally, through the browser
4. Observe the request, looking for state change, sensitivity, and
uniqueness
5. Look for any additional controls that could stop CSRF, such as
CAPTCHA or additional authentication
6. Log out and log in with a different set of credentials
7. Submit the initial request from the new context, and see if it is
successful
8. If the action is performed without issue, it is most likely CSRF
9. Remember that the issue must also satisfy the state change and
sensitivity requirements. Non-uniqueness is not enough.
Validation | Caution with Automation
Don’t trust the claims from tools. They’re often
right, but they’re only guessing at sensitivity:
 Validation of non-uniqueness doesn’t mean the
action is sensitive, i.e. it could be a “business”
false positive even if it’s valid technically
 CSRF is a high-false-positive vulnerability when
automation is used
 Tools make educated guesses that require
validation of all three criteria
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Defense
Defense | Overview
 The primary defense for Cross-site Request
Forgery is creating unique requests that cannot
be easily generated by attackers.
 This is usually accomplished via a nonce (a
number used once).
 CAPTCHAs can also be used, as well as
authentication prompts
Digging In | Nonces
<%
function session_initiate(first_name, last_name /* etc */) {
session.fisrt_name = first_name
session.last_name = last_name
/* etc */
session.form_token = generate_form_token()
}
%>
Then, in the page code:
<%
<form>
<input name=”field1”><br>
<input name=”field2”><br>
<input type=”submit”>
<input name=”form_token” type=”hidden” value=”<%= session.form_token %>”>
</form>
When the form is submitted, the following is executed:
if (post.form_token != session.form_token) {
log_CSRF_attack()
error_and_exit()
}
// normal form handling here
Defense | Nonces
 Nonces make it so that generic requests to
sensitive resources don’t get executed
 This works by providing a one-time-secret
when a legitimate client arrives at a given
location, and then that token (nonce) must be
submitted along with a request to prove that’s
legitimate
Defense | CAPTCHA
© Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Attack Vectors
Attack Vectors | Leveraging XSS
 The key to CSRF defense is that the attacker doesn’t
have access to a valid nonce
 But with XSS present the attacker could force the victim
to make a request to the site, consume the nonce, and
add it to the CSRF request
 This is what the Samy Worm did; he pulled the token first
and used it to submit the (now valid) friend addition
Attack Vectors | SAMY
Step #9 from Samy’s technical description
of his attack:
http://namb.la/popular/tech.html
Digging In | Clarification
Forcing the victim to execute the action (POST):
Attack Vectors | Options
 Take control of a legitimate, well-trafficked but
low priority internal site and post a form that
submits the attack
 Use persistent XSS to inject code on a
vulnerable site, e.g. a forum
 Create a new site internally and entice users
to visit the site via email, etc. (phishing-ish)
© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
CSRF Tester
CSRF Tester | Overview
• CSRF Tester is an
OWASP tool for creating
CSRF PoC code
• It works by capturing you
doing something
sensitive, and then
generating PoC code for
you try in another user
context
• You must set your
JAVA_HOME environment
variable to launch it
• Listens on port 8008
CSRF Tester | Usage
• Send traffic through CSRF
Tester like any other proxy
• Record the execution of a
sensitive action on the site
• You then create a “report”
of a certain
type, Form, iFrame, IMG,
XHR, Link
• That code is now the PoC
for testing to see if it’s a
CSRF issue
• The test is whether or not
it executes from other
© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Takeaways
Takeaways | Overview
1. CSRF is # 8 on the OWASP Top 10
2. Abuses server’s trust of client
3. Forces user to perform sensitive function
4. Validate by: State-change, Sensitivity, Non-uniqueness
5. Nonces are a common defense
6. XSS can assist CSRF by getting code onto a page and by
bypassing nonce defenses by having the user request a
valid nonce before submitting
7. Single sign-on can magnify CSRF issues
8. Remember that customers are deeply confused by CSRF
and will require constant reinforcement
9. Repetition: State(change)/Sensitivity/Uniqueness (SSU)
Takeaways | Resources
1. https://www.owasp.org/index.php/Cross-
Site_Request_Forgery_(CSRF)_Prevention_Cheat_
Sheet)
2. http://en.wikipedia.org/wiki/Cross-
site_request_forgery
3. https://www.owasp.org/index.php/Category:OWASP_
CSRFTester_Project
4. http://code.google.com/p/pinata-csrf-tool/
5. http://www.threadstrong.com/courses/csrf/
© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice.
Questions

Más contenido relacionado

La actualidad más candente

CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCSuvash Shah
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Barrel Software
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defensesMohammed A. Imran
 
Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Cross-Site Scripting (XSS)
Cross-Site Scripting (XSS)Daniel Tumser
 
Cross Site Scripting
Cross Site ScriptingCross Site Scripting
Cross Site ScriptingAli Mattash
 
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
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug BountiesOWASP Nagpur
 
OWASP API Security Top 10 Examples
OWASP API Security Top 10 ExamplesOWASP API Security Top 10 Examples
OWASP API Security Top 10 Examples42Crunch
 
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
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Irfad Imtiaz
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016Frans Rosén
 
HTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versionsHTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versionsneexemil
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...Noppadol Songsakaew
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourSoroush Dalili
 

La actualidad más candente (20)

CSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVCCSRF Attack and Its Prevention technique in ASP.NET MVC
CSRF Attack and Its Prevention technique in ASP.NET MVC
 
Building Advanced XSS Vectors
Building Advanced XSS VectorsBuilding Advanced XSS Vectors
Building Advanced XSS Vectors
 
Cross Site Scripting (XSS)
Cross Site Scripting (XSS)Cross Site Scripting (XSS)
Cross Site Scripting (XSS)
 
Cross site scripting attacks and defenses
Cross site scripting attacks and defensesCross site scripting attacks and defenses
Cross site scripting attacks and defenses
 
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 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
 
SSRF For Bug Bounties
SSRF For Bug BountiesSSRF For Bug Bounties
SSRF For Bug Bounties
 
Cross site scripting
Cross site scriptingCross site scripting
Cross site scripting
 
OWASP API Security Top 10 Examples
OWASP API Security Top 10 ExamplesOWASP API Security Top 10 Examples
OWASP API Security Top 10 Examples
 
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
 
Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )Introduction to Cross Site Scripting ( XSS )
Introduction to Cross Site Scripting ( XSS )
 
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
The Secret Life of a Bug Bounty Hunter – Frans Rosén @ Security Fest 2016
 
HTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versionsHTTP Request Smuggling via higher HTTP versions
HTTP Request Smuggling via higher HTTP versions
 
Deep dive into ssrf
Deep dive into ssrfDeep dive into ssrf
Deep dive into ssrf
 
A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...A2 - broken authentication and session management(OWASP thailand chapter Apri...
A2 - broken authentication and session management(OWASP thailand chapter Apri...
 
XSS
XSSXSS
XSS
 
Bug Bounty 101
Bug Bounty 101Bug Bounty 101
Bug Bounty 101
 
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ BehaviourWAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
WAF Bypass Techniques - Using HTTP Standard and Web Servers’ Behaviour
 
Command injection
Command injectionCommand injection
Command injection
 

Destacado

Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Nilesh Sapariya
 
Peak Prevention: Moving from Prevention to Resilience
Peak Prevention: Moving from Prevention to ResiliencePeak Prevention: Moving from Prevention to Resilience
Peak Prevention: Moving from Prevention to ResilienceDaniel Miessler
 
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 presentationAlbena Asenova-Belal
 
Sicurezza Informatica e Hacking - Università di Teramo 23/10/2015
Sicurezza Informatica e Hacking - Università di Teramo 23/10/2015Sicurezza Informatica e Hacking - Università di Teramo 23/10/2015
Sicurezza Informatica e Hacking - Università di Teramo 23/10/2015Pawel Zorzan Urban
 
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web [Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web Shreeraj Shah
 
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRFBe Afraid. Be Very Afraid. Javascript security, XSS & CSRF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRFMark Stanton
 
DEFCON 17 Presentation: CSRF - Yeah, It Still Works
DEFCON 17 Presentation: CSRF - Yeah, It Still WorksDEFCON 17 Presentation: CSRF - Yeah, It Still Works
DEFCON 17 Presentation: CSRF - Yeah, It Still WorksRuss McRee
 
[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+Csrf[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+CsrfBipin Upadhyay
 
CLUSIR INFONORD OWASP iot 2014
CLUSIR INFONORD OWASP iot 2014CLUSIR INFONORD OWASP iot 2014
CLUSIR INFONORD OWASP iot 2014Sebastien Gioria
 
The Real Internet of Things: How Universal Daemonization Will Change Everything
The Real Internet of Things: How Universal Daemonization Will Change EverythingThe Real Internet of Things: How Universal Daemonization Will Change Everything
The Real Internet of Things: How Universal Daemonization Will Change EverythingDaniel Miessler
 
SecLists @ BlackHat Arsenal 2015
SecLists @ BlackHat Arsenal 2015SecLists @ BlackHat Arsenal 2015
SecLists @ BlackHat Arsenal 2015Daniel Miessler
 
Spirent: The Internet of Things: The Expanded Security Perimeter
Spirent: The Internet of Things:  The Expanded Security Perimeter Spirent: The Internet of Things:  The Expanded Security Perimeter
Spirent: The Internet of Things: The Expanded Security Perimeter Sailaja Tennati
 
RSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of ThingsRSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of ThingsDaniel Miessler
 
Evolution of The Application
Evolution of The ApplicationEvolution of The Application
Evolution of The ApplicationDaniel Miessler
 
IoT Attack Surfaces -- DEFCON 2015
IoT Attack Surfaces -- DEFCON 2015IoT Attack Surfaces -- DEFCON 2015
IoT Attack Surfaces -- DEFCON 2015Daniel Miessler
 
Adaptive Testing Methodology [ ATM ]
Adaptive Testing Methodology [ ATM ]Adaptive Testing Methodology [ ATM ]
Adaptive Testing Methodology [ ATM ]Daniel Miessler
 
Implementing Inexpensive Honeytrap Techniques
Implementing Inexpensive Honeytrap TechniquesImplementing Inexpensive Honeytrap Techniques
Implementing Inexpensive Honeytrap TechniquesDaniel Miessler
 
Ppt on sql injection
Ppt on sql injectionPpt on sql injection
Ppt on sql injectionashish20012
 

Destacado (20)

Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
Its all about CSRF - null Mumbai Meet 10 January 2015 Null/OWASP Chapter
 
Peak Prevention: Moving from Prevention to Resilience
Peak Prevention: Moving from Prevention to ResiliencePeak Prevention: Moving from Prevention to Resilience
Peak Prevention: Moving from Prevention to Resilience
 
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
 
Sicurezza Informatica e Hacking - Università di Teramo 23/10/2015
Sicurezza Informatica e Hacking - Università di Teramo 23/10/2015Sicurezza Informatica e Hacking - Università di Teramo 23/10/2015
Sicurezza Informatica e Hacking - Università di Teramo 23/10/2015
 
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web [Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
[Infosecworld 08 Orlando] CSRF: The Biggest Little Vulnerability on the Web
 
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRFBe Afraid. Be Very Afraid. Javascript security, XSS & CSRF
Be Afraid. Be Very Afraid. Javascript security, XSS & CSRF
 
DEFCON 17 Presentation: CSRF - Yeah, It Still Works
DEFCON 17 Presentation: CSRF - Yeah, It Still WorksDEFCON 17 Presentation: CSRF - Yeah, It Still Works
DEFCON 17 Presentation: CSRF - Yeah, It Still Works
 
[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+Csrf[Php Camp]Owasp Php Top5+Csrf
[Php Camp]Owasp Php Top5+Csrf
 
CLUSIR INFONORD OWASP iot 2014
CLUSIR INFONORD OWASP iot 2014CLUSIR INFONORD OWASP iot 2014
CLUSIR INFONORD OWASP iot 2014
 
The Real Internet of Things: How Universal Daemonization Will Change Everything
The Real Internet of Things: How Universal Daemonization Will Change EverythingThe Real Internet of Things: How Universal Daemonization Will Change Everything
The Real Internet of Things: How Universal Daemonization Will Change Everything
 
SecLists @ BlackHat Arsenal 2015
SecLists @ BlackHat Arsenal 2015SecLists @ BlackHat Arsenal 2015
SecLists @ BlackHat Arsenal 2015
 
Spirent: The Internet of Things: The Expanded Security Perimeter
Spirent: The Internet of Things:  The Expanded Security Perimeter Spirent: The Internet of Things:  The Expanded Security Perimeter
Spirent: The Internet of Things: The Expanded Security Perimeter
 
RSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of ThingsRSA2015: Securing the Internet of Things
RSA2015: Securing the Internet of Things
 
Evolution of The Application
Evolution of The ApplicationEvolution of The Application
Evolution of The Application
 
Sql injection
Sql injectionSql injection
Sql injection
 
IoT Attack Surfaces -- DEFCON 2015
IoT Attack Surfaces -- DEFCON 2015IoT Attack Surfaces -- DEFCON 2015
IoT Attack Surfaces -- DEFCON 2015
 
Adaptive Testing Methodology [ ATM ]
Adaptive Testing Methodology [ ATM ]Adaptive Testing Methodology [ ATM ]
Adaptive Testing Methodology [ ATM ]
 
SQL Injection
SQL InjectionSQL Injection
SQL Injection
 
Implementing Inexpensive Honeytrap Techniques
Implementing Inexpensive Honeytrap TechniquesImplementing Inexpensive Honeytrap Techniques
Implementing Inexpensive Honeytrap Techniques
 
Ppt on sql injection
Ppt on sql injectionPpt on sql injection
Ppt on sql injection
 

Similar a Understanding Cross-site Request Forgery

Bank One App Sec Training
Bank One App Sec TrainingBank One App Sec Training
Bank One App Sec TrainingMike Spaulding
 
Security Testing Training With Examples
Security Testing Training With ExamplesSecurity Testing Training With Examples
Security Testing Training With ExamplesAlwin Thayyil
 
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...IBM Security
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelinesZakaria SMAHI
 
OWASPTop 10
OWASPTop 10OWASPTop 10
OWASPTop 10InnoTech
 
Security Testing
Security TestingSecurity Testing
Security TestingISsoft
 
INTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptx
INTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptxINTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptx
INTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptxSuhailShaik16
 
Core defense mechanisms against security attacks on web applications
Core defense mechanisms against security attacks on web applicationsCore defense mechanisms against security attacks on web applications
Core defense mechanisms against security attacks on web applicationsKaran Nagrecha
 
5 step plan to securing your APIs
5 step plan to securing your APIs5 step plan to securing your APIs
5 step plan to securing your APIs💻 Javier Garza
 
Common Web Application Attacks
Common Web Application Attacks Common Web Application Attacks
Common Web Application Attacks Ahmed Sherif
 
Cross site request forgery(csrf)
Cross site request forgery(csrf) Cross site request forgery(csrf)
Cross site request forgery(csrf) Ai Sha
 
Measures to ensure Cyber Security in a serverless environment
Measures to ensure Cyber Security in a serverless environmentMeasures to ensure Cyber Security in a serverless environment
Measures to ensure Cyber Security in a serverless environmentFibonalabs
 
The Complete Web Application Security Testing Checklist
The Complete Web Application Security Testing ChecklistThe Complete Web Application Security Testing Checklist
The Complete Web Application Security Testing ChecklistCigital
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top TenSecurity Innovation
 
OWASP TOP 10 by Team xbios
OWASP TOP 10  by Team xbiosOWASP TOP 10  by Team xbios
OWASP TOP 10 by Team xbiosVi Vek
 
[OPD 2019] Threat modeling at scale
[OPD 2019] Threat modeling at scale[OPD 2019] Threat modeling at scale
[OPD 2019] Threat modeling at scaleOWASP
 

Similar a Understanding Cross-site Request Forgery (20)

Bank One App Sec Training
Bank One App Sec TrainingBank One App Sec Training
Bank One App Sec Training
 
Owasp web security
Owasp web securityOwasp web security
Owasp web security
 
Security Testing Training With Examples
Security Testing Training With ExamplesSecurity Testing Training With Examples
Security Testing Training With Examples
 
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
Avoiding Application Attacks: A Guide to Preventing the OWASP Top 10 from Hap...
 
Secure coding guidelines
Secure coding guidelinesSecure coding guidelines
Secure coding guidelines
 
OWASPTop 10
OWASPTop 10OWASPTop 10
OWASPTop 10
 
Security Testing
Security TestingSecurity Testing
Security Testing
 
INTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptx
INTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptxINTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptx
INTERNSHIPREVIEW-ISHAQ (1) [Recovered].pptx
 
Owasp Top 10-2013
Owasp Top 10-2013Owasp Top 10-2013
Owasp Top 10-2013
 
Core defense mechanisms against security attacks on web applications
Core defense mechanisms against security attacks on web applicationsCore defense mechanisms against security attacks on web applications
Core defense mechanisms against security attacks on web applications
 
5 step plan to securing your APIs
5 step plan to securing your APIs5 step plan to securing your APIs
5 step plan to securing your APIs
 
Common Web Application Attacks
Common Web Application Attacks Common Web Application Attacks
Common Web Application Attacks
 
Cross site request forgery(csrf)
Cross site request forgery(csrf) Cross site request forgery(csrf)
Cross site request forgery(csrf)
 
Measures to ensure Cyber Security in a serverless environment
Measures to ensure Cyber Security in a serverless environmentMeasures to ensure Cyber Security in a serverless environment
Measures to ensure Cyber Security in a serverless environment
 
The Complete Web Application Security Testing Checklist
The Complete Web Application Security Testing ChecklistThe Complete Web Application Security Testing Checklist
The Complete Web Application Security Testing Checklist
 
C01461422
C01461422C01461422
C01461422
 
How to Test for The OWASP Top Ten
 How to Test for The OWASP Top Ten How to Test for The OWASP Top Ten
How to Test for The OWASP Top Ten
 
OWASP TOP 10 by Team xbios
OWASP TOP 10  by Team xbiosOWASP TOP 10  by Team xbios
OWASP TOP 10 by Team xbios
 
Nii sample pt_report
Nii sample pt_reportNii sample pt_report
Nii sample pt_report
 
[OPD 2019] Threat modeling at scale
[OPD 2019] Threat modeling at scale[OPD 2019] Threat modeling at scale
[OPD 2019] Threat modeling at scale
 

Último

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 

Último (20)

Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 

Understanding Cross-site Request Forgery

  • 1. © Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. Understanding Cross-site Request Forgery Daniel Miessler Principal Security Architect, HP Fortify May 2013
  • 2. Daniel Miessler, CISSP, CISA, GCIA Principal Security Architect, HP Fortify - 10 years experience doing security testing - 5 years experience doing appsec testing - Web Application Vulnerability Assessments - Mobile Application Vulnerability Assessments - Application Security Process Development - Enterprise Security Consulting daniel.miessler@hp.com Introductions
  • 3. Agenda - Problem - Basics - Description - Validation - Defenses - Attack Vectors - CSRF Tester - Takeaways
  • 4. © Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. Problem
  • 5. Problem | Overview  CSRF is an OWASP Top 10 vulnerability but it’s not as well understood as many others  Many struggle with how to validate it  Customers have difficulty explaining to management why it’s important to fix  We need to be well-versed in the main points to help the customer with their narrative to management
  • 6. © Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. Basics
  • 7. Basics | Overview  Often abbreviated as “CSRF” and pronounced as “Sea Surf”  #5 on the 2010 OWASP Top 10  #8 on the 2013 OWASP Top 10
  • 9. Basics | Description “Cross-site Request Forgery is a vulnerability in a website that allows attackers to force victims to perform security-sensitive actions on that site without their knowledge.”
  • 11. Basics | Description “Cross-site Request Forgery is a vulnerability in a website that allows attackers to force victims to perform security-sensitive actions on that site without their knowledge.”
  • 12. Basics | Description “Cross-site Request Forgery is a vulnerability in a website that allows attackers to force victims to perform security-sensitive actions on that site without their knowledge.”
  • 13. Basics | Description “Cross-site Request Forgery is a vulnerability in a website that allows attackers to force victims to perform security-sensitive actions on that site without their knowledge.”
  • 14. Basics | Description  What do we mean by “sensitive actions”?  How do attackers “force” victims to perform them?  And how do the victims not know it’s happening?
  • 15. 1. The target is a sensitive operation in the application, e.g. UpdateSalary.aspx, that’s able to be tricked into executing. 2. Victims can be forced to execute this action through any method that gets them to load a resource automatically, e.g. img tag, script tag, onload form submit, etc. Note: credentials go with all requests! 3. These happen unknowingly because the actions are performed by the victim’s browser, not by the victim explicitly. Basics | Description
  • 16. Sensitive action examples:  /EditDocument.aspx  /Login.do  /CreateAdmin.php  /UpdateStatus/ Basics | Examples
  • 17. Forcing the victim to execute the action (GET): - <img src=“http://site.com/transfer.php?fromac ct=2042&toacct=4497 /> (GET) Basics | Forced POSTs
  • 18. Forcing the victim to execute the action (POST): Basics | Description
  • 19. Both XSS and CSRF are possible due to abused trust relationships:  In XSS the browser will run malicious JavaScript because it was served from a site (origin) it trusts.  In CSRF the server will perform a sensitive action because it was sent by a client that it trusts. Basics | Trust Abuse
  • 20. © Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. Validation
  • 21. Validation | Criteria If you can’t change something using your CSRF vulnerability, then you don’t have one. Examples of state changes: - Updating an account (new password?) - Transferring funds - Changing the role of a user - Ordering an item - Adding an administrator to a system
  • 22. Validation | Criteria If your CSRF vulnerability doesn’t change something sensitive, then you might not have one. Note: sensitivity is a…sensitive matter. Who is it sensitive to? Could it be sensitive to some and not others?  Many changes are insignificant  Remember that if the business understands the technical risk then they automatically win the “what matters” argument
  • 23. Validation | Criteria If requests for your CSRF vulnerability are unique, you might not have one. Things to check for uniqueness: - Nonces - CAPTCHA - Multiple authentication levels
  • 24. Validation | Criteria The three components again… 1. Can you change state using it? 2. Is the function sensitive? 3. Is the request non-unique?  This is the core of the validation process  Any customer asking you to validate a CSRF vulnerability should hear and learn these same concepts
  • 25. Validation | WebInspect How WebInspect identifies CSRF: 1. Log in to the site 2. Complete a form and generate post request with current session cookies 3. If response is 30X, follow the redirection (with current session cookies) until the non-30x response is reached. This is response #1 (R1) 4. Log out and log in the site with different credentials (note session cookies should be changed here) 5. Resend the same POST request as in step 2, but with the new cookies 6. If necessary, follow redirects per step 3 7. Note the response as R2 8. If R1==R2, then it’s a non-unique request and therefore is CSRF-able
  • 26. Validation | Manual Validation How to manually verify CSRF: 1. Configure a proxy to observe traffic 2. Log in to the site with the issue in question 3. Perform the target functionality normally, through the browser 4. Observe the request, looking for state change, sensitivity, and uniqueness 5. Look for any additional controls that could stop CSRF, such as CAPTCHA or additional authentication 6. Log out and log in with a different set of credentials 7. Submit the initial request from the new context, and see if it is successful 8. If the action is performed without issue, it is most likely CSRF 9. Remember that the issue must also satisfy the state change and sensitivity requirements. Non-uniqueness is not enough.
  • 27. Validation | Caution with Automation Don’t trust the claims from tools. They’re often right, but they’re only guessing at sensitivity:  Validation of non-uniqueness doesn’t mean the action is sensitive, i.e. it could be a “business” false positive even if it’s valid technically  CSRF is a high-false-positive vulnerability when automation is used  Tools make educated guesses that require validation of all three criteria
  • 28. © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. Defense
  • 29. Defense | Overview  The primary defense for Cross-site Request Forgery is creating unique requests that cannot be easily generated by attackers.  This is usually accomplished via a nonce (a number used once).  CAPTCHAs can also be used, as well as authentication prompts
  • 30. Digging In | Nonces <% function session_initiate(first_name, last_name /* etc */) { session.fisrt_name = first_name session.last_name = last_name /* etc */ session.form_token = generate_form_token() } %> Then, in the page code: <% <form> <input name=”field1”><br> <input name=”field2”><br> <input type=”submit”> <input name=”form_token” type=”hidden” value=”<%= session.form_token %>”> </form> When the form is submitted, the following is executed: if (post.form_token != session.form_token) { log_CSRF_attack() error_and_exit() } // normal form handling here
  • 31. Defense | Nonces  Nonces make it so that generic requests to sensitive resources don’t get executed  This works by providing a one-time-secret when a legitimate client arrives at a given location, and then that token (nonce) must be submitted along with a request to prove that’s legitimate
  • 33. © Copyright 2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. Attack Vectors
  • 34. Attack Vectors | Leveraging XSS  The key to CSRF defense is that the attacker doesn’t have access to a valid nonce  But with XSS present the attacker could force the victim to make a request to the site, consume the nonce, and add it to the CSRF request  This is what the Samy Worm did; he pulled the token first and used it to submit the (now valid) friend addition
  • 35. Attack Vectors | SAMY Step #9 from Samy’s technical description of his attack: http://namb.la/popular/tech.html
  • 36. Digging In | Clarification Forcing the victim to execute the action (POST):
  • 37. Attack Vectors | Options  Take control of a legitimate, well-trafficked but low priority internal site and post a form that submits the attack  Use persistent XSS to inject code on a vulnerable site, e.g. a forum  Create a new site internally and entice users to visit the site via email, etc. (phishing-ish)
  • 38. © Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. CSRF Tester
  • 39. CSRF Tester | Overview • CSRF Tester is an OWASP tool for creating CSRF PoC code • It works by capturing you doing something sensitive, and then generating PoC code for you try in another user context • You must set your JAVA_HOME environment variable to launch it • Listens on port 8008
  • 40. CSRF Tester | Usage • Send traffic through CSRF Tester like any other proxy • Record the execution of a sensitive action on the site • You then create a “report” of a certain type, Form, iFrame, IMG, XHR, Link • That code is now the PoC for testing to see if it’s a CSRF issue • The test is whether or not it executes from other
  • 41. © Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. Takeaways
  • 42. Takeaways | Overview 1. CSRF is # 8 on the OWASP Top 10 2. Abuses server’s trust of client 3. Forces user to perform sensitive function 4. Validate by: State-change, Sensitivity, Non-uniqueness 5. Nonces are a common defense 6. XSS can assist CSRF by getting code onto a page and by bypassing nonce defenses by having the user request a valid nonce before submitting 7. Single sign-on can magnify CSRF issues 8. Remember that customers are deeply confused by CSRF and will require constant reinforcement 9. Repetition: State(change)/Sensitivity/Uniqueness (SSU)
  • 43. Takeaways | Resources 1. https://www.owasp.org/index.php/Cross- Site_Request_Forgery_(CSRF)_Prevention_Cheat_ Sheet) 2. http://en.wikipedia.org/wiki/Cross- site_request_forgery 3. https://www.owasp.org/index.php/Category:OWASP_ CSRFTester_Project 4. http://code.google.com/p/pinata-csrf-tool/ 5. http://www.threadstrong.com/courses/csrf/
  • 44. © Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. Questions

Notas del editor

  1. My name is [Name]. I work at HP as a [Title] in the Enterprise Security Products group.Today, we’ll talk about application security; what it is, why its needed, how to do it and what benefits you will see.
  2. Why is there a problem, and why do you need application security?Like all organizations, you’ve undoubtedly, invested a lot of time and money attempting to insulate and protect your assets. Your networks are protected – firewalls are in nearly every devices that connects to a network. Your servers are protected, thanks to advances in intrusion prevention systems. But your software applications are still largely unprotected and vulnerable.Companies believed that if you protect the perimeter (network and server), the software will be unreachable and therefore not breachable. However, that has not proven to be the case: software is the New Entry Point.Let’s take a look at how…
  3. Why is there a problem, and why do you need application security?Like all organizations, you’ve undoubtedly, invested a lot of time and money attempting to insulate and protect your assets. Your networks are protected – firewalls are in nearly every devices that connects to a network. Your servers are protected, thanks to advances in intrusion prevention systems. But your software applications are still largely unprotected and vulnerable.Companies believed that if you protect the perimeter (network and server), the software will be unreachable and therefore not breachable. However, that has not proven to be the case: software is the New Entry Point.Let’s take a look at how…