<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Web-Security on krash.dev</title><link>https://krash.dev/tags/web-security/</link><description>Recent content in Web-Security on krash.dev</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 14 Aug 2026 08:29:09 +0530</lastBuildDate><atom:link href="https://krash.dev/tags/web-security/rss.xml" rel="self" type="application/rss+xml"/><item><title>How is XSS different from CSRF?</title><link>https://krash.dev/posts/xss-vs-csrf/</link><pubDate>Tue, 28 Jun 2022 00:00:00 +0000</pubDate><guid>https://krash.dev/posts/xss-vs-csrf/</guid><description>&lt;p&gt;An interesting discussion, led me to realize this is one of the commonly discussed topic and I thought a blog post for it might be helpful for someone.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://portswigger.net/web-security/csrf" target="_blank" rel="noopener noreferrer"&gt;Cross-site request forgery&lt;/a&gt; and &lt;a href="https://portswigger.net/web-security/cross-site-scripting" target="_blank" rel="noopener noreferrer"&gt;Cross-site scripting&lt;/a&gt; are both client side attacks which performs action on behalf of users.&lt;/p&gt;
&lt;p&gt;Just some context here -&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://portswigger.net/web-security/cross-site-scripting" target="_blank" rel="noopener noreferrer"&gt;Cross-site scripting&lt;/a&gt; (or XSS) allows an attacker to execute arbitrary JavaScript within the browser of a victim user. The attack happen because of the acceptance of the malicious code by the sites.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://portswigger.net/web-security/csrf" target="_blank" rel="noopener noreferrer"&gt;Cross-site request forgery&lt;/a&gt; (or CSRF) allows an attacker to induce a victim user to perform actions that they do not intend to. This attack can be performed by the code hosted on any third party attacker controlled site.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Before diving into the differences, let&amp;rsquo;s see what conditions needs to be met in order for both the attacks to be successful.&lt;/p&gt;</description></item></channel></rss>