<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>CSRF prevention mechanism in form submit</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=97761969" />
  <subtitle>CSRF prevention mechanism in form submit</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=97761969</id>
  <updated>2026-06-28T13:40:37Z</updated>
  <dc:date>2026-06-28T13:40:37Z</dc:date>
  <entry>
    <title>RE: CSRF prevention mechanism in form submit</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110677322" />
    <author>
      <name>Christoph Rabel</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110677322</id>
    <updated>2018-08-08T10:53:45Z</updated>
    <published>2018-08-08T10:53:45Z</published>
    <summary type="html">&lt;p&gt;CSRF protection works differently. Let's say, I craft a URL that adds
  an admin user for me on site mysite:&lt;/p&gt;
&lt;p&gt;
  &lt;a href="https://mysite/create_admin_url/"&gt;https://mysite/create_admin_url/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Then I sent it to the admin of mysite with reasonable text:
  &amp;quot;Please look at my comment ...&amp;quot;. He clicks on the url and
  voila -&amp;gt; Admin created!&lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;
&lt;p&gt;CSRF prevents an attacker from doing that, he could maybe create a
  malicious URL or form and trick an admin to click on it. But for some
  attacker somewhere it is impossible to find out what the CSRF token of
  the current session of the admin user is.&lt;/p&gt;
&lt;p&gt;The token doesn't protect against e.g. injected javascript. It only
  protects against &amp;quot;tricks from the outside&amp;quot;.&lt;/p&gt;</summary>
    <dc:creator>Christoph Rabel</dc:creator>
    <dc:date>2018-08-08T10:53:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: CSRF prevention mechanism in form submit</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110677282" />
    <author>
      <name>nazim zmirli</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=110677282</id>
    <updated>2018-08-08T10:32:45Z</updated>
    <published>2018-08-08T10:32:45Z</published>
    <summary type="html">&lt;p&gt;I'm surely missing something in the picture of how CSRF attacks and
  protections are working. My understanding in a form-submit scenery is
  the protection rely on a unpredictable token, someway is assumed the
  attacker can't get the token, why? If the attacker is good enough to
  make me submit a form (as mentioned by OWASP) what would prevent him
  from getting the token before submitting? There's a limit on
  javascript size/syntax that can be injected or is just the assumption
  I'm using a modern browser with Same-Origin Policy, what am I not seeing?&lt;/p&gt;
&lt;p&gt;[url redacted]&lt;/p&gt;</summary>
    <dc:creator>nazim zmirli</dc:creator>
    <dc:date>2018-08-08T10:32:45Z</dc:date>
  </entry>
  <entry>
    <title>CSRF prevention mechanism in form submit</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97761968" />
    <author>
      <name>Akash Jaisawal</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=97761968</id>
    <updated>2017-10-31T07:54:41Z</updated>
    <published>2017-10-31T07:54:41Z</published>
    <summary type="html">Hi,&lt;br /&gt;&lt;br /&gt;I have a form which is getting submitted with processAction. I want to apply CSRF prevention mechanism. Regarding the same i have few quesitons.&lt;br /&gt;&lt;br /&gt;1. Do we need to apply CSRF prevention mechanism for processAction or not.&lt;br /&gt;2. If not how would i know that Liferay by default add &amp;#39;p_auth&amp;#39; key with the url, how can i check that?&lt;br /&gt;&lt;br /&gt;Regards&lt;br /&gt;Akash K Jaiswal</summary>
    <dc:creator>Akash Jaisawal</dc:creator>
    <dc:date>2017-10-31T07:54:41Z</dc:date>
  </entry>
</feed>
