ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

What is the difference between XSS and CSRF from their execution perspective?

2019-09-16 17:00:27  阅读:259  来源: 互联网

标签:XSS What difference CSRF between execution browser


What is the difference between XSS and CSRF from their execution perspective?

https://www.quora.com/What-is-the-difference-between-XSS-and-CSRF-from-their-execution-perspective/answer/Deepthi-210

Fundamental difference is that CSRF (Cross-site Request forgery) happens in authenticated sessions when the server trusts the user/browser,

while XSS (Cross-Site scripting) doesn't need an authenticated session and can be exploited when the vulnerable website doesn't do the basics of validating or escaping input.

 

In case of XSS, when the server doesn't validate or escapes input as a primary control, an attacker can send inputs via request parameters or any kind of client side input fields (which can be cookies, form fields or url params).These can be written back to screen , persisted in database or executed remotely.

For CSRF, consider an example when you are logged in into your banking site and at the same time logged into Facebook in another tab in same browser.

An attacker can place a malicious link embedded in another link or zero byte image which can be like your banksite.com/transfer.do?fromaccnt=youraccnt&toaccnt=attackersAccount&amt=2500.

Now, if you accidentally click on this link , in the background transfer can happen though you clicked from the Facebook tab.

 

This is because your session is still active in browser and browser has your session id.

This is the reason the most popular CSRF protection is having another server supplied unique token generated and appended in the request.

This unique token is not something which is known to browser like session id.

This additional validation at server (i.e whether the transfer request also contains the correct CSRF token) will make sure that the attacker manipulated link (I.e the CSRF attack) in above example will never work.

 

https://www.quora.com/What-is-the-difference-between-XSS-and-CSRF-from-their-execution-perspective/answer/Yash-Pandya-4

csrf is all about checking auth_tockens used in from , in csrf attck you can create spoof html form and force other victim to do things according to your need while xss is all about javascript execution . you can read more about both on owasp.org

 

https://www.quora.com/What-is-the-difference-between-XSS-and-CSRF-from-their-execution-perspective/answer/Gaurav-Sharma-2819

The fundamental difference between CSRF and XSS is that

cross-site scripting (XSS), is designed to exploit the trust the user has for a particular site

whilst

CSRF aims to exploit the trust that a website has in the visitor’s browser.

 

标签:XSS,What,difference,CSRF,between,execution,browser
来源: https://www.cnblogs.com/chucklu/p/11528284.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有