The vulnerability lies in the lack of output sanitization for rich text fields in Liferay's Dynamic Data Mapping framework. When a user inputs content into a rich text field, the backend stores this as an HTML string. The vulnerability is triggered when this stored HTML is rendered back to a user without being properly sanitized. This allows an attacker to inject malicious <script> tags or other HTML attributes that can execute JavaScript in the victim's browser.
The identified vulnerable function, com.liferay.dynamic.data.mapping.form.field.type.internal.renderer.RichTextDDMFormFieldRenderer.render, is the component responsible for this rendering process. During an exploit, a profiler would show this function being called as part of the page rendering process where the malicious rich text content is displayed. The fix for this vulnerability would involve modifying this function to use a sanitizer, such as Liferay's HtmlUtil.escape(), on the rich text content before it is written to the HTTP response. Although the exact commit was not found, the combination of the vulnerability description, the affected package, and the typical architecture of Liferay's DDM framework provides high confidence in this identification.