XSS – Cross site Scripting:
Bypass browser security via executing a script (external) in the context of vulnerable web application.
Reflective – Click the Malicious Link àExploit success (script executed)
- Hacker uploads the script on a vulnerable application and stored on the server (Eg: vulnerable Message boards, comment section etc).
- Another unfortunate user visits the pages and gets exploited.
Just recently Youtube was exploited with XSS Attack due to vulnerable comment section for the videos. In Response, youtube has hidden the comments until it was patched.
XSS Cheetsheet – View
Remedy: User Input Sanitization
XSRF – Cross site Request Forgery:
Exploits the applications trust on the user (user’s browser)
- User opens banking site with his credentials [ Session Opened ]
- User loads malicious website in another tab, which sends out a request to the bank to transfer the money to hackers account (or a moneymule) in the background (sending a POST or GET req with required parameters set).
- Banking server executes the transaction due to existing trusted session.
Introduce randomness for a transaction, i.e., some random token for each transaction/request that break predictable request.
How about an XSS Attack that captures required information (randomness) and necessary parameter values that fire XSRF Attack?