The analysis of the provided commits reveals a reflected cross-site scripting (XSS) vulnerability within the Liferay Portal. The root cause of this vulnerability lies in the escapeRedirect function located in com.liferay.portal.util.PortalImpl.
The vulnerability existed because the escapeRedirect function failed to properly sanitize and validate the scheme of the URL passed to it. This allowed for malicious javascript URIs (e.g., javascript:alert(1)) to be processed and reflected back to the user. When a user clicks on a crafted link containing such a URI, the javascript code executes in the user's browser session, leading to an XSS attack.
The patch, as seen in commit 7a1a7f0359e99be27ca04dab119e867c2263f040, addresses this issue by introducing a protocol validation mechanism. It adds a check to verify if the protocol of the given URL is present in a configurable list of allowed protocols. If the protocol is not in the allowed list, the function returns null, effectively blocking the malicious redirect. The addition of unit tests in commit 7c742f32f536dadfdbcad68acd20c63363728a25 further confirms this by explicitly testing for and nullifying redirects with javascript, file, and ftp protocols. The remaining commits are primarily for localization and configuration of this new security feature.
Therefore, the primary vulnerable function is com.liferay.portal.util.PortalImpl.escapeRedirect. During an exploit, this function would be present in the runtime profile as it processes the malicious URL.