The vulnerability is a stored Cross-Site Scripting (XSS) issue in Liferay Portal's "View Order" page. The root cause is the improper neutralization of user-supplied input in the "Name" text field of a "Terms and Condition". This allows an attacker to inject malicious HTML and script code, which is then stored in the database and executed in the browser of any user who views the order.
The provided commits address this vulnerability by adding input sanitization to several components. The most relevant commit is 433f82c03fac10167f1f811efb482d6010bac6db, which explicitly adds sanitization to the CPDefinition model's fields. The test case testAvoidMaliciousCodeInCPDefinitionFields in CPDefinitionLocalServiceTest.java demonstrates how a malicious payload could have been injected and is now properly escaped.
Additionally, two other commits were identified that, while not directly related to the "View Order" page, also address XSS vulnerabilities by adding HtmlUtil.escape to user-controlled data. These are 4218ecd902dbd860d3f9ee233b0ffa4c822a49ee in the MentionsPortlet and bccc5472db10281b5bec569eb2a3f9ddfb4035ec in the RichTextDDMFormFieldValueRenderer. These commits indicate a broader pattern of insufficient input sanitization in the affected Liferay Portal versions.
By exploiting this vulnerability, an attacker could perform various malicious actions, such as stealing session cookies, redirecting users to phishing pages, or executing arbitrary code in the context of the user's session. The identified vulnerable functions are critical to understanding how this vulnerability could be triggered and how to detect exploitation attempts.