HTML Injection in the Classic Search Portlet (Legacy)
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Resolution
- The mentioned code is inserted in a part of the JavaScript code, not the HTML code. It is escaped for JavaScript like below. Therefore, this is a false positive.
Liferay.Portlet.onLoad(
{
canEditTitle: false,
columnPos: 0,
isStatic: 'end',
namespacedId: 'p_p_id_com_liferay_portal_search_web_portlet_SearchPortlet_',
portletId: 'com_liferay_portal_search_web_portlet_SearchPortlet',
refreshURL: '\x2fc\x2fportal\x2frender_portlet\x3fp_l_id\x3d6\x26p_p_id\x3dcom_liferay_portal_search_web_portlet_SearchPortlet\x26p_p_lifecycle\x3d0\x26p_t_lifecycle\x3d0\x26p_p_state\x3dmaximized\x26p_p_mode\x3dview\x26p_p_col_id\x3dnull\x26p_p_col_pos\x3dnull\x26p_p_col_count\x3dnull\x26p_p_isolated\x3d1\x26currentURL\x3d\x252Fhome\x253Fp_p_id\x253Dcom_liferay_portal_search_web_portlet_SearchPortlet\x2526p_p_lifecycle\x253D0\x2526p_p_state\x253Dmaximized\x2526p_p_mode\x253Dview\x2526_com_liferay_portal_search_web_portlet_SearchPortlet_mvcPath\x253D\x25252Fsearch\x2ejsp\x2526_com_liferay_portal_search_web_portlet_SearchPortlet_redirect\x253Dhttp\x25253A\x25252F\x25252Flocalhost\x253A8080\x25252Fhome\x25253Fp_p_id\x25253Dcom_liferay_portal_search_web_portlet_SearchPortlet\x252526p_p_lifecycle\x25253D0\x252526p_p_state\x25253Dnormal\x252526p_p_mode\x25253Dview\x2526_com_liferay_portal_search_web_portlet_SearchPortlet_formDate\x253D\x25253Cmeta\x252520content\x25253D\x252522was-tnb-klk\x252522\x25253E\x25253Cdiv\x252520style\x25253D\x252522was-tnb-klk\x252522\x25253E\x25253Ca\x252520style\x25253D\x252522was-tnb-klk\x252522\x25253E\x25253Cstyle\x252520id\x25253D\x252522was-tnb-klk\x252522\x25253E\x2526_com_liferay_portal_search_web_portlet_SearchPortlet_keywords\x253Dnessus_was_textpw96gild\x2526_com_liferay_portal_search_web_portlet_SearchPortlet_scope\x253Dthis-site',
refreshURLData: {"_com_liferay_portal_search_web_portlet_SearchPortlet_keywords":["nessus_was_textpw96gild"],"_com_liferay_portal_search_web_portlet_SearchPortlet_mvcPath":["\/search.jsp"],"_com_liferay_portal_search_web_portlet_SearchPortlet_scope":["this-site"],"_com_liferay_portal_search_web_portlet_SearchPortlet_redirect":["http:\/\/localhost:8080\/home?p_p_id=com_liferay_portal_search_web_portlet_SearchPortlet&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view"],"_com_liferay_portal_search_web_portlet_SearchPortlet_formDate":["
Did this article resolve your issue ?