<?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>Escaping params in a form with ActionURL</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120820006" />
  <subtitle>Escaping params in a form with ActionURL</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=120820006</id>
  <updated>2026-04-03T19:58:56Z</updated>
  <dc:date>2026-04-03T19:58:56Z</dc:date>
  <entry>
    <title>Escaping params in a form with ActionURL</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120820005" />
    <author>
      <name>Jose Giron</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=120820005</id>
    <updated>2021-06-09T15:09:51Z</updated>
    <published>2021-06-08T23:36:10Z</published>
    <summary type="html">&lt;p&gt;Hi everyone, i have a jsp with a form and its actionURL is defined
  like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-html"&gt;&amp;lt;liferay-portlet:actionURL portletName=&amp;quot;buscador_WAR_cntxesuialumnosportlet&amp;quot; plid=&amp;quot;${plidBuscador}&amp;quot; varImpl=&amp;quot;searchTermURL&amp;quot; name=&amp;quot;searchTerm&amp;quot; &amp;gt;
	&amp;lt;liferay-portlet:param name=&amp;quot;mvcPath&amp;quot; value=&amp;quot;xxxx&amp;quot; /&amp;gt;
	&amp;lt;liferay-portlet:param name=&amp;quot;back&amp;quot; value='&amp;lt;%=yyyy%&amp;gt;' /&amp;gt;
&amp;lt;/liferay-portlet:actionURL&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and then there's the form like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-html"&gt;	&amp;lt;form action=&amp;quot;${fn:escapeXml(searchTermURL)}&amp;quot; method=&amp;quot;get&amp;quot; name=&amp;quot;buscador-form&amp;quot; class=&amp;quot;buscador-form&amp;quot;&amp;gt;
		&amp;lt;liferay-portlet:renderURLParams varImpl=&amp;quot;searchTermURL&amp;quot;/&amp;gt;
		&amp;lt;input name=&amp;quot;term&amp;quot; placeholder='&amp;lt;liferay-ui:message key=&amp;quot;buscador.placeholder&amp;quot; /&amp;gt;' type=&amp;quot;text&amp;quot; value=&amp;quot;${fn:escapeXml(term)}&amp;quot; class=&amp;quot;buscador-input&amp;quot; /&amp;gt;
        &amp;lt;input type=&amp;quot;submit&amp;quot; name=&amp;quot;tiny-buscador-button&amp;quot; class=&amp;quot;tiny-buscador-button&amp;quot; value=&amp;quot;&amp;quot; /&amp;gt;
	&amp;lt;/form&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The problem i have is that a test run by Acunetix software is
  detecting some Cross-site scripting vulnerabilities, for which i need
  to escape the characters.&lt;/p&gt;
&lt;p&gt;It detected one with the &amp;lt;input term&amp;gt; which seems to have been
  solved by using the ${fn:escapeXml(term)}, but then it threw another
  with the param &amp;quot;back&amp;quot; defined in the actionURL portlet. For
  this, i tried using the ${fn:escapeXml(term)}, but to no avail. The
  algorithm is setting the parameter to&lt;/p&gt;
&lt;p&gt;&amp;quot;&amp;lt;/script&amp;gt;&amp;lt;script&amp;gt;0H6Q(9003)&amp;lt;/script&amp;gt;&amp;quot;
  and i would need to escape it. I've read about the option
  &lt;strong&gt;escapeXML&lt;/strong&gt;, but i don't know if it would be helpful
  for this case, and i'm not sure how and where to use it exactly.&lt;/p&gt;
&lt;p&gt;In case of being helpful, would it have to be put in the definition
  of the parameter &amp;quot;back&amp;quot; or in the liferay-portlet:actionURL?&lt;/p&gt;
&lt;p&gt;Or maybe in the liferay-portlet:renderURLParams variable?&lt;/p&gt;
&lt;p&gt;By the way, i'm using Liferay 6.1.2 CE (i know it's pretty old, but
  it's out of my hands to update it...)&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;</summary>
    <dc:creator>Jose Giron</dc:creator>
    <dc:date>2021-06-08T23:36:10Z</dc:date>
  </entry>
</feed>
