Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Bug Hunting for Penetration Testers

You're reading from   Hands-On Bug Hunting for Penetration Testers A practical guide to help ethical hackers discover web application security flaws

Arrow left icon
Product type Paperback
Published in Sep 2018
Publisher Packt
ISBN-13 9781789344202
Length 250 pages
Edition 1st Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Himanshu Sharma Himanshu Sharma
Author Profile Icon Himanshu Sharma
Himanshu Sharma
Joe Marshall Joe Marshall
Author Profile Icon Joe Marshall
Joe Marshall
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Joining the Hunt FREE CHAPTER 2. Choosing Your Hunting Ground 3. Preparing for an Engagement 4. Unsanitized Data – An XSS Case Study 5. SQL, Code Injection, and Scanners 6. CSRF and Insecure Session Authentication 7. Detecting XML External Entities 8. Access Control and Security Through Obscurity 9. Framework and Application-Specific Vulnerabilities 10. Formatting Your Report 11. Other Tools 12. Other (Out of Scope) Vulnerabilities 13. Going Further 14. Assessment 15. Other Books You May Enjoy

CSRF and Insecure Session Authentication

Cross-Site Request Forgery (CSRF) is when an attacker takes advantage of a logged-in user's authenticated state to execute malicious application requests and change the user's app in harmful ways. Because the attacker can't see the result of any attack, it's usually less about exfiltrating information and more about exploiting the app's capabilities (for example, making the user of a mobile payment system send money to the wrong person). There's often a strong social engineering aspect involved: phishing and other techniques are used to get a user to click on the link that will kick off a malicious request and act as the CSRF attack vector.

CSRF is often possible because authentication credentials or cookies meant for one part of an application mistakenly allow access to another. An example would be that while you're logged into PayPal or another payment app, you click on a link sent to you in a chat session. The link executes code that takes the authentication cookie you have in your browser to make an (authenticated) request sending money to the attacker. Unlike XSS, the danger isn't that you'll send sensitive information to the attacker, allowing them to impersonate or defraud you later; instead, the danger is a direct consequence of the actions you're allowed to take as a logged-in user of the app.

Many frameworks (Spring, Joomla, and Django) have their own solutions for preventing CSRF, which usually consist of tying a cookie's authentication ability to a specific in-app action. But, despite CSRF's status as a solved problem, it persists as a recurring bug in the annual OWASP Top-10 surveys. Like SQLi, CSRF is a simple-but-damaging vulnerability that endures largely because of the tension in software development between security and productivity.

The following topics will be covered in this chapter:

  • Mechanics of CSRF
  • Tools to use for finding and validating CSRF vulnerabilities
  • Discovering, validating, and reporting on CSRF vulnerabilities
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image