<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sarath Devireddy on Medium]]></title>
        <description><![CDATA[Stories by Sarath Devireddy on Medium]]></description>
        <link>https://medium.com/@sarathdevireddy?source=rss-1387eb090a64------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*J0RuO467Z9JHjz46</url>
            <title>Stories by Sarath Devireddy on Medium</title>
            <link>https://medium.com/@sarathdevireddy?source=rss-1387eb090a64------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:53:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sarathdevireddy/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cross Site Request Forgery Attack (part-1)]]></title>
            <link>https://medium.com/@sarathdevireddy/cross-site-request-forgery-attack-70e90c40e1fc?source=rss-1387eb090a64------2</link>
            <guid isPermaLink="false">https://medium.com/p/70e90c40e1fc</guid>
            <category><![CDATA[csrf]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[owasp-top-10]]></category>
            <category><![CDATA[preflight-request]]></category>
            <category><![CDATA[csrf-attack]]></category>
            <dc:creator><![CDATA[Sarath Devireddy]]></dc:creator>
            <pubDate>Fri, 01 Nov 2024 07:42:18 GMT</pubDate>
            <atom:updated>2024-11-01T07:44:50.029Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone! I’m Sarath D, a cybersecurity professional. In this blog, I aim to provide valuable insights into CSRF (Cross-Site Request Forgery) to help those working in information security or bug bounty hunting. CSRF can sometimes be confusing, even for experienced professionals, so my goal here is to clarify the mechanics behind this attack. By the end of this blog, you’ll have a solid understanding of CSRF and its underlying concepts.</p><blockquote>Before we dive into the main topic, I kindly ask everyone to excuse any grammatical errors and feel free to correct me if there are any mistakes in the technical explanations. Please note, this blog is intended solely for educational purposes — always act responsibly and avoid any unethical activities.</blockquote><blockquote>I’ll begin with a basic overview of CSRF, explaining how it works in real-world scenarios and the main causes behind it.and I’ll aim to present the content using more images. In my experience, visualizations lead to better understanding than purely theoretical explanations.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*1un_dAECUPL9gWo99Y72EA.png" /><figcaption><strong>The image provides a complete overview of how a victim unknowingly executes a CSRF attack.</strong></figcaption></figure><p>When discussing CSRF, the key point to remember is that the forged request originates from a cross-domain or third-party site. I’ll begin with a practical, step-by-step scenario, followed by an explanation of the root causes behind CSRF. For this example, we’ll use bank.com as the victim’s logged-in site and evil.com as the attacker’s site.</p><ol><li><strong>First,</strong> a person named Santosh logs into <strong><em>bank.com</em></strong> using a web browser. After he’s authenticated as a legitimate user, the server assigns him cookies, which are stored locally in his browser. These cookies are responsible for authenticating Santosh’s identity with each subsequent request he makes to the site.</li><li>After Santosh logs into bank.com, he can use various functionalities such as transferring money, checking his balance, and conducting other financial transactions.</li><li>This is where the real attack occurs. The attacker observes misconfigurations in the application and creates forged requests that trick the victim, Santosh, into executing malicious activities without his knowledge.</li></ol><blockquote><em>&lt;!DOCTYPE html&gt;<br>&lt;html lang=”en”&gt;<br>&lt;head&gt;<br> &lt;meta charset=”UTF-8&quot;&gt;<br> &lt;meta name=”viewport” content=”width=device-width, initial-scale=1.0&quot;&gt;<br> &lt;title&gt;Malicious Page&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br> &lt;h1&gt;Special Offer!&lt;/h1&gt;<br> &lt;p&gt;Click the button below to claim your reward:&lt;/p&gt;<br> <br> &lt;! — Hidden form that submits a request to transfer funds →<br> </em><strong><em>&lt;form id=”csrfForm” action=”https://bank.com/transfer” method=”POST”&gt;</em></strong><em><br> &lt;input type=”hidden” name=”amount” value=”1000&quot;&gt;<br> &lt;input type=”hidden” name=”to_account” value=”attacker_account”&gt;<br> &lt;/form&gt;<br> <br> &lt;script&gt;<br> // Automatically submit the form when the page loads<br> document.getElementById(“csrfForm”).submit();<br> &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</em></blockquote><p>Above html code contains hidden form with post request which update on server.</p><p>4. The attacker creates the domain <em>evil.com</em>, which contains an embedded hidden form targeting the money transfer URL of <em>bank.com</em> via a simple POST request.</p><p>5. When the victim santosh visits evil.com, which contains the embedded request, the forged request is automatically submitted. This happens because Santosh is already logged into bank.com in the same browser, allowing the browser to automatically send the cookies associated with bank.com along with the request to the attacker’s domain, evil.com.</p><p>6. Once the victim, Santosh, submits the request unknowingly, the forged money transfer request transfers funds from <em>bank.com</em> to the attacker’s account specified in the HTML code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/0*6czz11YFMserjAj9.png" /></figure><p>Above image shows csrf attack scenario overview in visualization format.</p><blockquote>While the scenario described is familiar to many, I want to highlight that I will explore the complete root causes of CSRF, why it happens, and what occurs on the backend in a future blog post. Trying to cover all these details in one blog can be complex and might overwhelm learners.</blockquote><p>I will provide remaining content in next continuation part-2 blog with below mentioned points.</p><ol><li>What is simple request ? and how simple request cause for CSRF Attack?</li><li>What is custom headers ? why this headers important in any state changing requests ?</li><li>What is sop and how it works ?</li><li>What is preflight request and how is works with custom headers ?</li><li>Why content type request header and cookie header with same-site attribute is important for any request ?</li></ol><p>Please like, share, and comment on the blog. Thank you for your support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70e90c40e1fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>