<?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>CSP unsafe-inline unsafe-eval</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122408544" />
  <subtitle>CSP unsafe-inline unsafe-eval</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=122408544</id>
  <updated>2026-05-13T05:50:56Z</updated>
  <dc:date>2026-05-13T05:50:56Z</dc:date>
  <entry>
    <title>RE: RE: CSP unsafe-inline unsafe-eval</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122412339" />
    <author>
      <name>Václav Suchánek</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122412339</id>
    <updated>2024-02-21T08:01:21Z</updated>
    <published>2024-02-21T08:01:20Z</published>
    <summary type="html">&lt;p&gt;Thank you, Zsigmond.&lt;/p&gt;</summary>
    <dc:creator>Václav Suchánek</dc:creator>
    <dc:date>2024-02-21T08:01:20Z</dc:date>
  </entry>
  <entry>
    <title>RE: CSP unsafe-inline unsafe-eval</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122409171" />
    <author>
      <name>Zsigmond Rab</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122409171</id>
    <updated>2024-02-21T08:01:25Z</updated>
    <published>2024-02-20T12:52:33Z</published>
    <summary type="html">&lt;p&gt;Hi Václav,&lt;/p&gt;
&lt;p&gt;We have been working on CSP support in the portal already. You can
  watch the &lt;a
  href="https://liferay.atlassian.net/browse/LPD-16463"&gt;https://liferay.atlassian.net/browse/LPD-16463&lt;/a&gt;
  initiative and the related tickets. It's still behind feature flag but
  we are working on releasing a basic set of directives to support.
  We're just planning how to extend the list of the supported directives
  in time afterwards. Eliminating 'unsafe-inline' and 'unsave-eval' will
  be a step in the process.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br&gt; Zsigmond&lt;/p&gt;</summary>
    <dc:creator>Zsigmond Rab</dc:creator>
    <dc:date>2024-02-20T12:52:33Z</dc:date>
  </entry>
  <entry>
    <title>CSP unsafe-inline unsafe-eval</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122408543" />
    <author>
      <name>Václav Suchánek</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=122408543</id>
    <updated>2024-02-20T09:26:03Z</updated>
    <published>2024-02-20T09:26:02Z</published>
    <summary type="html">&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Motivation:&lt;br&gt; From pentesting there are findings like:&lt;br&gt;
  &amp;quot;Potentially insecure policy ineffective headers:
  Content-Security-Policy&amp;quot;&lt;br&gt; Or from &lt;a
  href="https://securityheaders.com/"&gt;https://securityheaders.com/&lt;/a&gt;
  there is:&lt;br&gt; &amp;quot;This policy contains 'unsafe-inline' which is
  dangerous in the script-src directive. This policy contains
  'unsafe-eval' which is dangerous in the script-src directive.&amp;quot;&lt;/p&gt;
&lt;p&gt;Remediation:&lt;br&gt; There is no need for “unsafe-inline” and
  “unsafe-eval” directives, fix the Content-Security-Policy header.&lt;/p&gt;
&lt;p&gt;Testing:&lt;br&gt; When &amp;quot;unsafe-inline&amp;quot; and
  &amp;quot;unsafe-eval&amp;quot; are removed within the script-src directive
  then the login page is disabled. Login form (inputs and submit button)
  throwing the following to the browser console:&lt;br&gt; &amp;quot;Refused to
  execute inline script because it violates the following Content
  Security Policy directive: ...&amp;quot;&lt;br&gt; &amp;quot;Uncaught
  ReferenceError: Liferay is not defined&amp;quot;&lt;br&gt; And I think there are
  more buttons and control elements disabled within the portal.&lt;/p&gt;
&lt;p&gt;Conclusion:&lt;br&gt; I know this is rather a recommendation than a
  limitation. But according to:&lt;br&gt;
  &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src"&gt;https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/script-src&lt;/a&gt;
  &lt;br&gt; &amp;quot;Disallowing inline styles and scripts is one of the biggest
  security wins CSP provides.&amp;quot;&lt;br&gt; So my question is: Is there any
  Liferay DEV plan to eliminate
  &amp;quot;unsafe-inline&amp;quot;|&amp;quot;unsafe-eval&amp;quot; directives?&lt;/p&gt;</summary>
    <dc:creator>Václav Suchánek</dc:creator>
    <dc:date>2024-02-20T09:26:02Z</dc:date>
  </entry>
</feed>
