The vulnerability is a reflected cross-site scripting (XSS) issue in Liferay Portal, identified as CVE-2025-43817. The vulnerability is triggered when a user is directed to the 'Announcements' or 'Alerts' pages with a malicious redirect parameter in the URL. The value of this parameter is used to construct a navigation link, but it is not properly sanitized, leading to the execution of injected scripts.
The analysis of the provided patch commit 40b9dcafccff4b0ba2a20ef4c9723bea820f814b reveals the root cause of the vulnerability. The commit modifies the portal-web/docroot/html/taglib/aui/button/end.jsp file, which is a JSP tag file responsible for rendering buttons in the Liferay UI.
The vulnerable code snippet is:
<c:when test="<%= Validator.isNotNull(escapedHREF) %>">
<button ... onClick="Liferay.Util.navigate('<%= escapedHREF %>')" ...>
</c:when>
Here, escapedHREF is populated with the value from the redirect parameter. By crafting a malicious redirect parameter, an attacker can break out of the string literal in the Liferay.Util.navigate function and inject arbitrary JavaScript. For example, a redirect value of x' onload='alert(1) would result in executable JavaScript.
The patch fixes this by separating the data from the code. The escapedHREF is now stored in a data-href attribute, and the onClick handler safely retrieves this value using this.dataset.href. This ensures that the redirect parameter is treated as data and not as executable code.
Since this is a JSP file, it gets compiled into a Java Servlet at runtime. The vulnerable code is executed within the _jspService method of the compiled servlet. Therefore, the function org.apache.jsp.html.taglib.aui.button.end_jsp._jspService is the precise function that would appear in a runtime profile during the exploitation of this vulnerability.